Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danimelo1
Creator
Creator

Help on set analysis Qlik Sense

Hi experts,

Giving this table:

data.jpg

I need to show only person id, who have a action different of  U5 with the folowing list of Action Reason reason: U2, Z1.

So in this case, it should exclude Person ID: 3048, 6037, 8311, 11530.


I'm trying this but it doesn`t work:

=if([Action]='U5'] and [Action Reason]<>'U2' or [Action Reason]<>'Z1',[Person ID])

What am I missing?

Regards,

Daniel M

1 Solution

Accepted Solutions
sunny_talwar

Try this

=If([Action] = 'U5' and Match([Action Reason], 'U2', 'Z1'), [Person ID])

View solution in original post

5 Replies
Ivan_Bozov
Luminary
Luminary

Hi, try this:

Only({<Action-={'U5'}, [Action Reason]={'U2','Z1'}>}PersonID)

vizmind.eu
danimelo1
Creator
Creator
Author

It gives me an error of Invalid dimension. I'm trying to present it in a straight table

Ivan_Bozov
Luminary
Luminary

This is a measure.

Edit: I have misread your requirement. So you are trying to exclude the combinations U5+Z1 and U5+U2?

Create the following line in the script.

IF(Action='U5' AND MATCH([Action Reason],'Z1','U2'), 'Exclude','Include') AS Flag

Then your script will look something like this:

Load

    PersonID,

    Action,

    [Action Reason],

    IF(Action='U5' AND MATCH([Action Reason],'Z1','U2'), 'Exclude','Include') AS Flag

Inline [

PersonID,Action,Action Reason

3048,U5,Z1

4433,U9,U2

11530,U5,U2

11135,U5,U1

]

(Delimiter is ',')

In the table use the following measure:

Only({<Flag={'Include'}>}PersonID)

Capture.PNG

vizmind.eu
sunny_talwar

Try this

=If([Action] = 'U5' and Match([Action Reason], 'U2', 'Z1'), [Person ID])

danimelo1
Creator
Creator
Author

Genius!!

Thank you Sunny, I was expecting if you some day replied this answer.  You Rocks!