on 06-01-2015 2:19 PM
Hello all,
For a customer requirement, i need to count PO (EKPO) linked to Invoices (RSEG) but only if it's linked.
I have a calculation view linking EKPO to RSEG but with an outer join so i have records with populateed PO number (EBELN) and blank Invoice number (EBLNR).
So here i need to do sothing like this :
IF EBELN and BELNR populated put 1 in the counter
IF EBELN populated and BELNR is null put 0
And also i want to count the same EBELN only once even if it's linked to many BELNR.
Thank you very much
Soufiane
Hi,
Create one calculate column name as 'Counter' .
Apply condition as below:
if("EBELN" != ' ' and "BELNR" != ' ',1,if("EBELN" != ' ' and "BELNR" = NULL,0,' '))
BR
Sumeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sufiane,
You can achieve this with 2 step process.
1) Create a calculated column with the below condition
if(isnull("BELNR"),0,1)
Note: you don't need to use EBELN in condition because your condition checks just BELNR value.
2) Create counter on calculated column. -- This does distinct count
Right click on 'Calculated Column' folder and select 'Counter' option. select column as calculated column.
Counter is only available in aggregation node in calculation view.
Regards,
Venkat N.
Hello Venkatesh,
Thank you for your reply.
This solution is not working actually, i tried it also because it will count some orders (EBELN) twice or more if they are linked to more than one invoice (BELNR).
Example :
EBELN EBELP BELNR CALCULATED COUNT DISTINCT
A B C 1 1
A B NULL 0 1
A B D 1 1
When aggregation :
CALCULATED COUNT DISTINCT
2 2
The result expected for count distinct is 1 because i want to count the orders (EBELN) linked to invoices (BELNR) only once.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.