Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: AND OR combination condition in set analysis

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
Valued Contributor III

Re: AND OR combination condition in set analysis

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

MVP
MVP

Re: AND OR combination condition in set analysis

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

MVP
MVP

Re: AND OR combination condition in set analysis

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
Valued Contributor III

Re: AND OR combination condition in set analysis

Looking for OR condition in set analysis

Not applicable

Re: AND OR combination condition in set analysis

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
Honored Contributor II

Re: AND OR combination condition in set analysis

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
MVP
MVP

Re: AND OR combination condition in set analysis

Did you try what I suggested?

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

Re: AND OR combination condition in set analysis

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
Honored Contributor II

Re: AND OR combination condition in set analysis

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