Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A customer is using KPIs and Tables with the same formula and she is getting different results. She wants to know why this is happening. Is there anything wrong with the formula?
Thanks in advance!
Are they suppressing NULL values for 'Respondent Name' or ''Email Address' in the table?
The differences may have something to do with suppressing nulls, but I would suggest that the expression is incorrectly formulated to begin with. I understand the user wants to "count CountResponseNumber where ResponseStatusFilter is not 'Partial Response' or 'Status Not Reported'".
If I understand the requirement correctly, then the correct structure would be to put the if test inside the Count().
Count(DISTINCT If(ResponseStatusFilter <> 'Partial Response' or ResponseStatusFilter <> 'Status Not Reported', CountResponseNumber))
or better
Count(DISTINCT If(not Match(ResponseStatusFilter, 'Partial Response', 'Status Not Reported'),CountResponseNumber))
or even better still use Set Analysis:
Count({<ResponseStatusFilter -= {'Partial Response', 'Status Not Reported'}>} DISTINCT CountResponseNumber)
There is a logical difference between putting the If() inside or outside of an aggregation.
if(test, Sum(x))
If the test is true, Sum(x) -- that's all x values.
Sum(if(test, x))
Sum x values only where the test is true.
My guess is that in the example, all the reported counts for CountResponseNumber are too large.
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com