Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count based on Aging and other conditions

I have the table that shows count of Active cases (called Incidents).  The age of an incident is calculated by Today - Incident Date.  I want them to ignore time selections, is why the {1}.

Total is correct as below:

Sum({1}ActiveCaseCnt)

Less than 15 days old is correct as below:

COUNT({1<StateValue={"Active"}>}if((today()-IncidentDate<15),1))

Other ranges would not be correct because the below would count Less than 25 days but also Less than 15 days.  I know how to do this in Excel but I can't seem to get it right in Qlik Sense.

COUNT({1<StateValue={"Active"}>}if((today()-IncidentDate<25),1))

Visualization currently looks like this and they obviously don't add up to the total... What's the exact expression to set the range for Less than 25 days old but more than 15 days old, and so on?  I need to get this published for Monday or I will be stuck manipulating row data on Sunday.... Thanks for your help.

1 Solution

Accepted Solutions
sunny_talwar

May be this

Count({1<StateValue={"Active"}>} If(Today()-IncidentDate<25 and Today()-IncidentDate >=15,1))


Count({1<StateValue={"Active"}>} If(Today()-IncidentDate<35 and Today()-IncidentDate >=25,1))

and so on....

View solution in original post

2 Replies
sunny_talwar

May be this

Count({1<StateValue={"Active"}>} If(Today()-IncidentDate<25 and Today()-IncidentDate >=15,1))


Count({1<StateValue={"Active"}>} If(Today()-IncidentDate<35 and Today()-IncidentDate >=25,1))

and so on....

Not applicable
Author

Amazing!  Thanks again