Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
124psu
Creator II
Creator II

using set analysis in KPI to count # of colored cells in a straight table

I have a table that I have added a background expression based on some logic to either be green or red. Now that I have that squared away, I'd like to have a 2 high level KPI to count the number of green and red cells in my straight table. I've read somewhere that you can use the same logic to achieve, but Qlik doesn't let me aggr with an if statement. Wondering on how to achieve this?

Labels (2)
2 Replies
Lisa_P
Employee
Employee

Whatever the if condition is in your color expression, could potentially be created using set analysis for your KPI. Can you share your color expression ?

124psu
Creator II
Creator II
Author

asdasd.PNGThis is my syntax for coloring the 2 columns.

if(sum(fabs([Refund])) = sum(fabs([Payment])), green(), lightred())

I want to count the number of matching red rows. In this example - the kpi should show count 2. I've tried your method with placing my background expression into my kpi incorporating a count if but that errors me out.