Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Luis_Arocho-LLantin

KPIs and Tables.

 

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?

Luis_ArochoLLantin_2-1655912329926.pngLuis_ArochoLLantin_3-1655912342562.png

 

 

Luis_ArochoLLantin_4-1655912380616.png

 

Thanks in advance!

 

Labels (3)
2 Replies
Qlik_Eric_Thomas

Are they suppressing NULL values for 'Respondent Name'  or ''Email Address' in the table?

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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