Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a dataset which only stores monthly sales of materials when actual sales have occured.
When calculating the average, Qlikview doesn't take the months without sales into account.
I'm looking for a solution to calculate the average correct without adding extra records for the months without sales.
Here is screenshot of the situation:
The average sales based on the 4 months should be 87,5. Now Qlikview is only considering months 1-3.
Do you have any ideas? Thanks.
James.
Hi James,
Please try the following expression instead of AVG(Sales).
=sum(Sales)/count(TOTAL Month)
Rgds,
Hi James,
This is because Material 1 is not associated to month 4. You would have noticed that when Material 1 was explicitly selected '4' was excluded from the month's selection making the count of months to 3.
One suggestion could be that instead of keeping the sales value in month 4 blank, you can put in sales value as 0 for Material 1 in the 4th Month.
Hope this helps.
Rgds, Amit.
Hi Amit,
In order to keep the number of records as small as possible, I don't want to add records with zero sales as I mentioned before.
Kind regards,
James.