Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

"OR" Condition in Set Analysis

What is the syntax to express an "or" condition in a Set Analysis statement?  For example I want to get the sum of ORIGBAL when OPENDATE or CLOSEDATE fall within a variable date parameter.  I can test only OPENDATE with the following statement.. 

      =SUM ({$<OPENDATE={'>=$(vSelectedMinDate)<=$(vSelectedMaxDate)'}>}ORIGBAL)

How do I test for either OPENDATE OR CLOSEDATE to be within the date parameter to sum the balance?

Thanks for the help

Ed

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Hi Edward,

The '+' sign is or in set analysis.

=SUM ({$<OPENDATE={'>=$(vSelectedMinDate)<=$(vSelectedMaxDate)'}> + <CLOSEDATE={'>=$(vSelectedMinDate)<=$(vSelectedMaxDate)'}>}ORIGBAL)


Regards

KC

Best Regards,
KC

View solution in original post

4 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Try this format.

SUM({<FIELD1 = {1}> + <FIELD2 = {2}>}Sales)

jyothish8807
Master II
Master II

Hi Edward,

The '+' sign is or in set analysis.

=SUM ({$<OPENDATE={'>=$(vSelectedMinDate)<=$(vSelectedMaxDate)'}> + <CLOSEDATE={'>=$(vSelectedMinDate)<=$(vSelectedMaxDate)'}>}ORIGBAL)


Regards

KC

Best Regards,
KC
Anonymous
Not applicable
Author

Thanks for the help.  I read through the Set Analysis help screens and did not find any reference as to how to join statements together.

Thanks again.

Ed

jyothish8807
Master II
Master II

You are welcome

Regards

KC

Best Regards,
KC