Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AND OR combination condition in set analysis

Hi All,

I have a requirement where I need to use OR condition in set analysis.

This is my exact requirement what i am looking for.

[GIDFLAG={'0'} and BS ={'A','B'} and region={'US'} and [Channel ={'A','B','C'} or ( Channel ={'D'} and custno={'1','2,'3'} )] and

vDeli={'LCD'} and PSI='S11]

Every time I have been failing in underlined condition.

how we can use above condition in set analysis function,Any suggestions should appreciates.

Thanks

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If I understand you right you want a set expression to filter as follows:

GIDFLA={'0'} and BS={'A','B'} and Region={'US'} and Channel={'A','B','C'}

OR

Channel={'D'} and custno={'1','2,'3'}

Then use:

{<GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'A','B','C'}> + <Channel={'D'}, custno={'1','2,'3'}>}

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

12 Replies
vardhancse
Specialist III
Specialist III

Even me also have same requirement, in set analysis we can get AND condition but OR condition I don't think so.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If I understand you right you want a set expression to filter as follows:

GIDFLA={'0'} and BS={'A','B'} and Region={'US'} and Channel={'A','B','C'}

OR

Channel={'D'} and custno={'1','2,'3'}

Then use:

{<GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'A','B','C'}> + <Channel={'D'}, custno={'1','2,'3'}>}

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If you want the first 3 terms to apply to the whole filter:

GIDFLA={'0'} and BS={'A','B'} and Region={'US'} and Channel={'A','B','C'}

OR

GIDFLA={'0'} and BS={'A','B'} and Region={'US'} and Channel={'D'} and custno={'1','2,'3'}

Then:

{<GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'A','B','C'}> + <GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'D'}, custno={'1','2,'3'}>}

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vardhancse
Specialist III
Specialist III

Looking for OR condition in set analysis

Not applicable
Author

try like this swathiRaj,

sum({<GIDFLAG = {'0'},BS={'A','B'},region={'US'},channel={'A','B','C'},custno={'1','2','3'},vDeli={'LCD'},PSI={'s11'}>

         +<GIDFLAG = {'0'},BS={'A','B'},regions={'US'},channel={'D'},custnp={'1','2','3'},vDeli={'LCD'},PSI={'s11'}>} sales)

jyothish8807
Master II
Master II

HI Swathi,

AS Jonathan mentioned above in set analysis if you want to use AND condition then write expression seperated by Comma(,)

eg:

sum({<GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'A','B','C'}>}sales)

For OR condition use(+) sign in set analysis:

sum({<GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'A','B','C'}> + <GIDFLA={'0'}, BS={'A','B'}, Region={'US'}, Channel={'D'}, custno={'1','2,'3'}>}sales)

Regards

KC

Best Regards,
KC
jonathandienst
Partner - Champion III
Partner - Champion III

Did you try what I suggested?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks for your replies.But In this below condition custno is depenpds on channel D only ,not on whole set.

GIDFLA={'0'} and BS={'A','B'} and Region={'US'} and

[Channel={'A','B','C'}

OR

[Channel={'D'} and custno={'1','2,'3'}]]----this is separate set depends on CHannel D only not on whole set.

thanks

jyothish8807
Master II
Master II

Try this:

sum({<GIDFLA={'0'},BS={'A','B'},Region={'US'},[Channel={'A','B','C'}>+<Channel={'D'},custno={'1','2,'3'}>}sales)

Regards

KC

Best Regards,
KC