Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
mromrod22
Partner
Partner

Clause OR in set analysis

Hi community,

I have a pivot table with a static expression, and I need control a filter "dynamically", for try avoid a too long expression.

count(DISTINCT {<Mes={'Ene','Feb'}, [Revisión plan anual]={'Rev0'}>} SOLI_ID_SOLICITUD)

  +

count(DISTINCT {<Mes={'Mar','Abr'}, [Revisión plan anual]={'Rev1'}>} SOLI_ID_SOLICITUD)

Explain the expression:

Each Revision must link with two months (Rev0 with Ene and Feb, Rev1 with Mar and Abr...), but I must do statically. In this reduced example I control the output when check Rev0 and Rev1, but the problem comes when check Rev0, Rev1, and Ene, Feb, Mar. Automatically include IDs of Abr.

I need, if is possible, a clause OR where I control the value of "Mes" applied depending of "Mes" checked ( if check two months or one of them).

I know that this must be done dynamically, but the script has been done wrong and I haven´t time to change all the code.

Thanks.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I believe I haven't fully understood what you are trying to achieve.

If you need your set analysis consider user selections in Mes field, you can use the intersection set operator * to achieve an intersection (only consider Mar, if Abr is not selected, but both months if both are selected):

count(DISTINCT {<Mes *= {'Ene','Feb'}, [Revisión plan anual]={'Rev0'}>} SOLI_ID_SOLICITUD)

  +

count(DISTINCT {<Mes *= {'Mar','Abr'}, [Revisión plan anual]={'Rev1'}>} SOLI_ID_SOLICITUD)

View solution in original post

2 Replies
swuehl
MVP
MVP

I believe I haven't fully understood what you are trying to achieve.

If you need your set analysis consider user selections in Mes field, you can use the intersection set operator * to achieve an intersection (only consider Mar, if Abr is not selected, but both months if both are selected):

count(DISTINCT {<Mes *= {'Ene','Feb'}, [Revisión plan anual]={'Rev0'}>} SOLI_ID_SOLICITUD)

  +

count(DISTINCT {<Mes *= {'Mar','Abr'}, [Revisión plan anual]={'Rev1'}>} SOLI_ID_SOLICITUD)

View solution in original post

mromrod22
Partner
Partner
Author

Now works perfectly!!

Very thanks.