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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with Variable

Hello,

I am attempting to create an expressions that counts unique person_ids when the person_id is associated to 2 or more encntr_ids.

Thus far I have had no luck in creating this expressions. The variables  vCntPerson and vCntEncntr are simply just counting the unique person_ids and encntr_ids.

=count(Distinct{<$(=vCntPerson)={"$(= '=' & '1' & $(=vCntEncntr) '>=' & '2')"}>} PERSON_ID)

Any help would be appreciated.

Thanks in advance!

Jordan

6 Replies
MK_QSL
MVP
MVP

=count(Distinct{<$(=vCntPerson)={"=$(vCntEncntr)>=2"}>} PERSON_ID)

pgrenier
Partner - Creator III
Partner - Creator III

Hello Jordan,

I believe you may get the desired result with the following expression:

=Count({<PERSON_ID={“=Count(encntr_ids) > 1”}>} DISTINCT PERSON_ID)


Regards,


Philippe

Not applicable
Author

Hi Manish,


Thank you for your quick response, however I am getting an error in set modifier expression with a 'red line' under the second open '{'.

Not sure why it does not like it there.


Thanks!

Jordan

Not applicable
Author

Hi Philippe,


Thank you for your response, however  this expression returns a count of 0 for me.

Thanks!

Jordan

MK_QSL
MVP
MVP

Can you load sample file?

pgrenier
Partner - Creator III
Partner - Creator III

Hello Jordan,

There was a typo in the previous expression with one of the double quote characters. This version should work if you copy-paste:

=Count({<PERSON_ID={"=Count(encntr_ids) > 1"}>} DISTINCT PERSON_ID)


Regards,


Philippe