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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
youss123
Contributor III
Contributor III

Count Distinct if sum result is less than X

Hi All,

 

Please help me out correcting my set analysis expression,

I want to Count Tickets  when the Sum of duration of Statut  "New" + "Assignment" is less than 6 days 

Knowing that : 

= Sum({<Statut ={"New","Assignment"}  >} [Statut_Duration]

Calculate the desired duration.

& this is how I count my  tickets

= Count( distinct {<Statut ={"New","Assignment"} >} [%Key - Ticket])

 

Thanks,

Y

Labels (2)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this: 

Count( distinct {<[%Key - Ticket]={"=Sum({<Statut ={'New','Assignment'}  >} [Statut_Duration])<6"},Statut ={'New','Assignment'} >} [%Key - Ticket]

View solution in original post

4 Replies
GaryGiles
Specialist
Specialist

Try this: 

Count( distinct {<[%Key - Ticket]={"=Sum({<Statut ={'New','Assignment'}  >} [Statut_Duration])<6"},Statut ={'New','Assignment'} >} [%Key - Ticket]

youss123
Contributor III
Contributor III
Author

Thank you Sir 

youss123
Contributor III
Contributor III
Author

Another small question please , is it possible to count the number of tickets over a range of duration i.e. greater than and less than.

 

Thank you 

Y

GaryGiles
Specialist
Specialist

In this case, you would need to write it like this:

Count( distinct {<[%Key - Ticket]={"=Sum({<Statut ={'New','Assignment'}  >} [Statut_Duration])<6 and Sum({<Statut ={'New','Assignment'}  >} [Statut_Duration])>2"},Statut ={'New','Assignment'} >} [%Key - Ticket])