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: 
OmarBenSalem
Partner - Champion II
Partner - Champion II

Need help to understand an expression( set analysis)

Hi all ( @sunny_talwar ) (It's been a while btw, hope u're doing well !!)

Well my request is rather simple, to help understand this expression I made but that didn't do as I wanted it to :

 

Count( distinct {


<ID_QUESTION={'1'},Regroupement_ID={'2'},ID_REPONSE={'5','4','3'}>
*
<ID_QUESTION={'2'},Regroupement_ID={'2'},ID_REPONSE={'1','2','3','4','5','6'}>

} UserID)

 

What I want to do is :

Count the UserID that are part of Regroupement_ID=2 and responded to Question =1 by responses 3,4 OR 5

and to Question 2 by responses 1,2,3,4,5, OR 6

Isn't my expression supposed to return this?

Because it returns 0 while I'm pretty sure 0 is not the expected outcome.

What am I doing wrong?

3 Replies
sunny_talwar
MVP
MVP

Try this

Count(DISTINCT {<UserID = P({<ID_QUESTION = {'1'}, Regroupement_ID = {'2'}, ID_REPONSE = {'5','4','3'}>}) * P({<ID_QUESTION = {'2'}, Regroupement_ID = {'2'}, ID_REPONSE = {'1','2','3','4','5','6'}>})>} UserID)

 

OmarBenSalem
Partner - Champion II
Partner - Champion II
Author

Same result.. 0.

Don't understand why ! 

 

sunny_talwar
MVP
MVP

Create a straight table with UserID as dimension and two expressions

1)

Count(DISTINCT {<UserID = P({<ID_QUESTION = {'1'}, Regroupement_ID = {'2'}, ID_REPONSE = {'5','4','3'}>})>} UserID)

2)

Count(DISTINCT {<UserID = P({<ID_QUESTION = {'2'}, Regroupement_ID = {'2'}, ID_REPONSE = {'1','2','3','4','5','6'}>})>} UserID)

Do you see rows where both the expressions are giving 1?