
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count If less than/equal to issue
I always struggle with a "countif" setup in Qlikview -- it's one of the few things that Excel or Numbers are far better at.
I am trying to count cases if the calculated variance is <= 0.
I created a variable "StartVariance" (one date/time subtracted from another date/time) -- and on my straight table, it shows the expected results.
Ultimately, I need to calculate the percentage of cases that have a variance of 0 or less than 1 (meaning we started on time or early). But I need the count of those cases first.
I searched and found this option:
count({StartVariance=["<=0"]>} DISTINCT CASE_COUNT)
It gives me the result "1" -- it should tell me 46
If I take out the DISTINCT, it just gives me the total number of cases.
I've attached a file with the data pertinent to this expression.
Ideas? Solutions?
Thanks! Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this
Count({<StartVariance = {"<=0"}>} CASE_COUNT)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
no, changing the type of brackets doesn't make a difference.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I attached an example of how to perform the calculations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure exactly how you did this, as I can't select the "frequency" if I'm using an expression variable (instead of a pre-defined variable name). And it doesn't really answer my question, unfortunately.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
= count({<Variance={ "<=1"}>} Variance)
= count({<Variance={ "<=1"}>} distinct Variance)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
count(if(Variance<=0,Variance)) or count({<Variance={"<=0"}>} Variance)
