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 multiple AND,OR conditions

There are several "OR" and "AND" condition in my set analysis. The below code is not providing the correct results. What am I missing? Any help you can provide is appreciated. Thanks!

CRITERIA:

Based on the current user selection count distinct CSN_ID's if the following condition is met:

     Either HK7959 OR OFF_HK7959 has a value of 'Y'

               AND

     Either HK8017 OR OFF_HK8017 has a value of 'Y'

               AND

     Either HK8020 OR OFF_HK8020 has a value of 'Y'

               AND

     Either HK8024 OR OFF_HK8024 has a value of 'Y'

               AND

     Either HK8032 OR OFF_HK8032 has a value of 'Y'

               AND

     Either HIP2111 OR OFF_HIP2111 has a value of 'Y'

({$<HK7959={'Y'}>+<OFF_HK7959={'Y'}>*<HK8017={'Y'}>+<OFF_HK8017={'Y'}>*<HK8020={'Y'}>+<OFF_HK8020={'Y'}>*<HK8024={'Y'}>+<OFF_HK8024={'Y'}>*<HK8032={'Y'}>+<OFF_HK8032={'Y'}>*<HIP2111={'Y'}>+<OFF_HIP2111={'Y'}> }DISTINCT CSN_ID)

3 Replies
JonnyPoole
Former Employee
Former Employee

Silly question... have you considered creating this as calculated field in the load script ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Use parentheses to group the union sets and give them precedence over the intersection sets, like in

...{(Set_A + Set_B) * (Set_C + Set_D) * (Set_E...}...

Best,

Peter

Not applicable
Author

Thanks!