Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik Community,
I am using an Avg() function in my script, trying to calculate the average value of some numeric values (e.g. sales amounts).
However, some of my data contain text like 'N/A' which should not be taken into account when calculating the average value.
So my question is: Does Avg() ignore these values or does it sum them up as zero which will have an impact on the average?
Thank you very much in advance!
Stefan
AFAIK and based on testing =RangeAvg(1, 'NA', 2) = 1.5... Avg will ignore NA and find the average based on the numbers only.
Hi,
There is no impact, If the field (sales amounts) has 'N/A' value.It doesn't affect the sales amount avg
Thank you both for answering. This was what I expected, just wanted to check if I was right!
Stefan
Hi Stefan,
unfortunately, it impacts avg but not sum.
When you have strings or nulls, and using aggregations, qlik will consider them as "Zero" while performing aggregation.
So for Sum, you may not see any effect. but for Avg() I think it will effect.
Thank you,
Naveen