Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
phiilip
Contributor II
Contributor II

Count number of occurences where one measure is larger than another

Hello!

I have two measures, let's call them A and B for simplicity's sake. Both of these measure are over time, by week in this case. Now I want to display a KPI where I count the amount of times where A > B. How do I implement this logic in the frontend?

Thanks in advance!

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

Without knowing what the measures are, a general answer: Use Aggr().

Sum(Aggr(If(Sum(A) > Sum(B),1),YourDim1,YourDim2))

View solution in original post

1 Reply
Or
MVP
MVP

Without knowing what the measures are, a general answer: Use Aggr().

Sum(Aggr(If(Sum(A) > Sum(B),1),YourDim1,YourDim2))