Hi all,
I would like to define a new KPI to measure the ratio of eProcurement (EP) orders vs. all other PO doc types. The doc type information comes from the PO header (EKKO), however Id like to show the ratio based on line item level (EKPO). The formula which Ive set-up and which works fine for the ratio on Header looks as follows:
100 * AVG(CASE WHEN EKKO.BSART = EP THEN 1.0 ELSE 0.0 END)
Somehow, Ive to bring in one more variable to take line items into account: COUNT_TABLE(EKPO)
Any idea how to combine to show the ratio of EP PO items?
Thanks, Oli
Page 1 / 1
Hey Oli,
If I understand correctly you want to show the ratio between the EP PO Lines and the not EP PO lines.
Although there are definitely different approaches for a solution of your problem, I would recommend going with a PU_COUNT to pull the amount of Positions per Header from the EKPO on the EKKO level and setting the right filter. This would look something like this:
100 *
SUM(PU_COUNT(EKKO, EKPO.POSNR, EKKO.BSART = EP))
/
SUM(PU_COUNT(EKKO, EKPO.POSNR, EKKO.BSART != EP))
Best Regard,
Benedict
If I understand correctly you want to show the ratio between the EP PO Lines and the not EP PO lines.
Although there are definitely different approaches for a solution of your problem, I would recommend going with a PU_COUNT to pull the amount of Positions per Header from the EKPO on the EKKO level and setting the right filter. This would look something like this:
100 *
SUM(PU_COUNT(EKKO, EKPO.POSNR, EKKO.BSART = EP))
/
SUM(PU_COUNT(EKKO, EKPO.POSNR, EKKO.BSART != EP))
Best Regard,
Benedict
Thanks for the fast help. The proposed solution works fine with two small adjustments:
100 *
SUM(PU_COUNT(EKKO, EKPO.EBELP, EKKO.BSART = EP))
/
SUM(PU_COUNT(EKKO, EKPO.EBELP))
Thanks again for the help! Oli
- I had to replace POSNR with EBELP according to the data model used
- In order to show the ratio of EP PO Lines vs. all PO lines I had to remove the second part of the filter EKKO.BSART != EP
100 *
SUM(PU_COUNT(EKKO, EKPO.EBELP, EKKO.BSART = EP))
/
SUM(PU_COUNT(EKKO, EKPO.EBELP))
Thanks again for the help! Oli
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.