I want to sum only distinct values. And here´s my problem. I created a variable with the order and the position of the order (CONCAT VKBEL & POS). And now I want to SUM the amount of the order quantity of all variables. But the variable occurs more than once. Is there a function that only sum distinct values? Thanks in advance for any ideas.
or is there a possibility to filter out the variable that occurs more than once?
Hi Silvia,
I think this could be a solution:
SUM(PU_FIRST(DOMAIN_TABLE(VKBEL. POS),VALUE)) , you might need to e.g. use a MAX or an ORDER BY to get the right value as I don't know your exact situation.
Does that help? Good luck,
Lucas
Dear Lucas, thank you so much for your fast reply. I found a solution for my problem. I have aggregated my data on the wrong table. Now I use the VBAP and pull the data from the VBFA to the VBAP that I don´t need the variable anymore and create only one line per case.
Unfortunatly the Domain_Table function did not work in my case (maybe I didn´t use it properly) so I have to find this other way.
Regards,
Silvia
Hi Silvia,
I believe you are now aggregating directly in the case level (VBAP), so something like
PU_COUNT(VBAP,VBFA.RFMNG_FLO)
But if you want to aggregate to the Sales Order Level, you can use the DOMAIN_TABLE. This function creates a virtual table and is commonly use when the tables are not directly connected.
Alternatively, you can also check the BIND() function that has a similar functionality
celonis.cloud/help/display/CIBC/BIND
Best,
Gabriel
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.