Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

and's and or's together in set analysis

I am in need of help with a specific set analysis condition. I will just make up field names to get across what I am looking for:

(Field1= 'a') and (Field2 = 'b') and (Field3='c' or Field4='d' or Field5  = 'e')

Can anyone translate this into a set analysis condition for me? Thank you.

3 Replies
Employee
Employee

Re: and's and or's together in set analysis

Here is an example of

Year = 2004 and Region = 'North America'  or Salesman ID=2002

sum(  {$<Year={2004},Region={'North America'}> + $<[Salesman ID]={2002}> } Sales)

setanalysis.PNG.png

Not applicable

Re: and's and or's together in set analysis

How would I incorporate multiple or's into one condition?

Employee
Employee

Re: and's and or's together in set analysis

You could adding another '+' operator like this example.

Strictly speaking the '+' means UNION. So the 2 sets are unioned together to include both result sets together. So its a different logic mechanism then AND/OR strictly speaking but it should work.

sum(  {$<Year={2004},Region={'North America'}> + $<[Salesman ID]={2002}> + $<[Salesman ID]={2003}>  } Sales)

setanalysis2.PNG.png

Or you could also do if statements to do the same. When you don't specifiy a 3rd parameter in the If statement , the false conditions evaluate to null and are by default suppressed from the chart (presentation tab -> suppress missing)

Community Browser