Hi experts,
I am fed-up with Webi and its way to aggregate the data.
I have been trying, for 2 days now, to do something really simple with BEX but which cannot be done in BEX because of WEBI limitation (except some body can tells me a trick!).
I am trying to get a material counter where a KF is set to 1. Pretty simple would you say ! But no... I am not able to find a way to do it:
Here is the "incoming table"
Year | Month | Material | Internal / External | Valid |
---|---|---|---|---|
2014 | 12.2014 | M1 | Internal | 1 |
2014 | 12.2014 | M1 | External | 1 |
2015 | 01.2015 | M1 | Internal | 0 |
2015 | 01.2015 | M1 | Internal | 0 |
2015 | 01.2015 | M2 | Internal | 1 |
2015 | 01.2015 | M2 | External | 0 |
2015 | 02.2015 | M3 | Internal | 1 |
2015 | 02.2015 | M3 | External | 1 |
2015 | 02.2015 | M4 | Internal | 1 |
2015 | 02.2015 | M4 | External | 1 |
I want to get a dynamic result following the user parameters (filters).
I want to count the number of distinct Material per month for which the Valid KF = 1.
So I need to get the following Result when no filter on Internal/External is set:
Month | Count |
---|---|
12.2014 | 1 |
01.2015 | 1 |
02.2015 | 2 |
When the flag is set to external I should be able to get:
Month | Count |
---|---|
12.2014 | 1 |
01.2015 | 0 |
02.2015 | 2 |
If the user set the Internal / External value then the count should also evolved.
I have tried many things:
Count(Material, Distinct) ForAll (Month) in Year where (Valid = 1)
Count (Material, DIstinct) ForEach(Month) inYear Where (valid = 1)
Count (Material, Distinct) Where Valid = 1 forEach (Month) in (Year)
And I always get the number of distinct Material whatever the Valid flag value is set to!
Does anybody has an Idea?
Thanks.
Cheers,
Cyril.