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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
tahirkhalil
Creator
Creator

AND in Set Analysis

HI All,

How can I implement AND within SET.

I have an example - one ticket contain multiple activities and have responses against each.

For me a valid ticket is only one which have Activity A3 and A4 both with response 1.

I know if I use =count(DISTINCT {<Activity={"A3","A4"}, Response={1}>} Ticket) - it is working as OR. I want to use condition:

(Activity = A3 AND Activity = A4) AND Response=1

How to achieve that through set analysis? See attached document.

 

Regards,

 

Tahir

 

Labels (3)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

=count(DISTINCT {<Ticket=p({<Activity={'A3'}, Response={1}>})
*
p({<Activity={'A4'}, Response={1}>})>} Ticket)

View solution in original post

4 Replies
Thiago_Justen_
MVP
MVP

Your set is ok. Try it without the distinct...I guess you have the same ticket for both activities and response. Then you got only 1 as result because of the distinct.
Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
tresB
Champion III
Champion III

Try like:

=count(DISTINCT {<Ticket=p({<Activity={'A3'}, Response={1}>})
*
p({<Activity={'A4'}, Response={1}>})>} Ticket)
tahirkhalil
Creator
Creator
Author

No the set is wrong - in fact it is working as OR I want this to be done as AND

robert99
Specialist III
Specialist III

Hi

I haven't a clue what you are trying to achieve to be honest

But would this work

count(DISTINCT {<Activity={"A3","A4"}>} Ticket)

+

count(DISTINCT {<Response={1}>} Ticket)