Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to get the average of the stock for the selected period of time.
The expression I use is: sum(Stock)/count(MM) see file attached
in the example (F)emale has a stock of 1 in Apr 2019 and (M)ale a stock of 1 in May 2019. Now selecting both month I expect a value of 0.5 for both and not 1 for the average stock.
I hope someone understands my problem and can help me.
a possible solution could be the following:
Sum(Stock)/(Count(TOTAL DISTINCT {1} MM)*Count(TOTAL DISTINCT {1} JJ))
so I get always the average of the selected period.
sum(Stock)/count(Total MM)
This shows the right value of 0.5, but when i select M I still get a stock of 1 ?????
I think that its correct 1 because there is only 1 month for each Gender, M and F.
Well, for me it is not ok. When I select Apr and May so I expect the average of these two month. And when M has a stock of 1 in May and and no stock in Apr, so for me the correct average should be 0.5 and not 1 for the period of these two months.
Is there no simple solution for these problem?
a possible solution could be the following:
Sum(Stock)/(Count(TOTAL DISTINCT {1} MM)*Count(TOTAL DISTINCT {1} JJ))
so I get always the average of the selected period.