Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can somebody help me with this please:
I've bumped into this problem while i was trying to calculate the average of sum sales in Sep
+ with the sum/count date : sum({<DateCode={">=$(vPresentMonth) <=$(vPMonthEnd)"}>} NoOfOrders)/count({<DateCode={">=$(vPresentMonth) <=$(vPMonthEnd)"}>} distinct DateCode)--> get the exact value compare to my caculator
+with the avg(): avg(aggr(sum({<DateCode={">=$(vPresentMonth) <=$(vPMonthEnd)"}>} NoOfOrders),DateCode))--> a wrong number
here's the thing: I found that there's only 6 days that the sum(sales) is divided by, but avg() divided it by 7 instead of 6.Can somebody explain me this?
I would be so appreciate for your help with this!!!!
Picture attached below.
There is probably nothing wrong with the avg() else it will be a matter of your datamodel and/or the data-quality. Maybe there are any missing values or NULL's within the data or DateCode might be key field ... I could imagine that it may display your expected value if you add the condition to the outer aggregation, too:
avg({<DateCode={">=$(vPresentMonth) <=$(vPMonthEnd)"}>}
aggr(sum({<DateCode={">=$(vPresentMonth) <=$(vPMonthEnd)"}>} NoOfOrders),
DateCode))
- Marcus
Thanks very much Marcus, I really appreciate it.
I'll check again my data-modeling and quality of data.