Skip to main content

Hello Everyone,

I need to compare for each Vendor the amount of POs of last week to the average number of POs per week of the 12 weeks before (from today -2 until -13). Im only not totally sure on how I can solve this issue?

I use this formula for the amount of POs of last week.

PU_COUNT_DISTINCT(LFA1, EKKO.EBELN,

(CASE WHEN ROUND_WEEK(EKKO.TS_AEDAT) = ADD_DAYS(ROUND_WEEK(TODAY()),-7) THEN 1.0 ELSE 0.0 END)=1.0)

And tried using Moving Average for the average over multiple weeks, but Im not getting this solved in a way which would provide me with just 1 average.

Table need to look like this:

Vendor POs last week Average # POs per week over the earlier 12 weeks

XYZ 8 3,2

Thanks in advance for any help on this topic.

Best Regards,

Pim

Solved it. I had to build further on the already build function.

PU_COUNT_DISTINCT(LFA1, EKKO.EBELN,

(CASE WHEN EKKO.TS_AEDAT BETWEEN ADD_DAYS(ROUND_WEEK(TODAY()),-91) AND ADD_DAYS(ROUND_WEEK(TODAY()),-14) THEN 1.0 ELSE 0.0 END)=1.0

)/12


Reply