Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count with two conditions

Hello Sense Community,

I am rather new to QilkSense and required your help for the following question.

E.g. given the following priority data.

 

PriorityP1P2P3P4P5
1>150%>150%>110%>150%>90%
2..........
3..........

AND

  

OverDuePercentWorkType
98%P1
161%P2
111%P2
100%P2
125%P5
101%P1

I planned to use the priority as Measures (1, 2 and 3).

I have looked for the count statement with condition and came out with the following.

count({<OverDuePercent={'>150'}, WORKTYPE={'P1','P2','P4'}>} WorkNum)

However, I cant seems to add another condition of >110 P3 or >90 P5 into the count.

What i want to achieve is something like this in excel using countifs with multiple conditions:

countifs(OverduePercent=">150", WorkType="P1","P2","P4", OverduePercent=">110", WorkType="P3")

Please help me community, sorry if my question isn't clear, i will re-explain if needed.

Thanks!

1 Solution

Accepted Solutions
OmarBenSalem

You want

count({<OverDuePercent={'>150'}, WORKTYPE={'P1','P2','P4'}>} WorkNum)


or count it when overDue>110 and worktype= p3

or count it when overDue>90 and worktype= p5


right?


If so, try this:


count({ <OverDuePercent={'>150'}, WORKTYPE={'P1','P2','P4'}>


+ <OverDuePercent={'>110'}, WORKTYPE={'P3'}>


+<OverDuePercent={'>90'}, WORKTYPE={'P5'}>


} WorkNum)

View solution in original post

3 Replies
OmarBenSalem

You want

count({<OverDuePercent={'>150'}, WORKTYPE={'P1','P2','P4'}>} WorkNum)


or count it when overDue>110 and worktype= p3

or count it when overDue>90 and worktype= p5


right?


If so, try this:


count({ <OverDuePercent={'>150'}, WORKTYPE={'P1','P2','P4'}>


+ <OverDuePercent={'>110'}, WORKTYPE={'P3'}>


+<OverDuePercent={'>90'}, WORKTYPE={'P5'}>


} WorkNum)

Not applicable
Author

Here's the full explanation: link.

Not applicable
Author

Thanks! I was thinking that it will be much more complicated such as including if else, you saved me!