Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if only statement

Hi,

I am back again with a simple question, and very much hopeful to get the help from experts:)

I have a simple table like below

FL

MS

AA

X

AA

Y

AA

Z

BB

Y

BB

Z

CC

Z

CC

Y

DD

W

DD

Y

DD

Z



Now if I select both fields on QV and select Y and Z from the MS selection list, the FL list should only show those containing ONLY Y and Z

right now, when i select y and Z, the FL list shows all the values which even have ONLY 'Y' OR 'Z'

a sudocode might be like

Select FL if only (MS='Z' AND MS='Y')

The resutl as per above table should be BB and CC only

Thanks in advance.

KRs/Asad

5 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

look at the example, I used set analysis, maybe that helps you

Not applicable
Author

Hi Martina,

Thanks for your help but unfortunately, I still have the free version of QV, using for testing before we buy its licence, so I am unable to open your attached file, can you please share the code?

Thanks & BRs,

Asad

Not applicable
Author

The expression from the file that Martina posted above that only shows B and C is

Expression:

=If(Count({<MS/={"Y","Z"}>} MS)=0, Count(MS),0)

But it shows 2 for both, I suppose if you only wanted it to say 1 you could just use count(distinct .

Not applicable
Author

Hi,

Thanks but not worked yet Sad

KRs/

Not applicable
Author

Hi again,

Thanks for the help again, I applied the suggested set analyses but got a problem after expanding my table. Now the table looks like below:

FLMSposition
AAX1
AAY2
AAZ3
BBY1
BBZ2
CCZ1
CCY2
DDY1
DDY2


and the suggested code returns DD as well.

Please help.

Thanks & BRs,

Asad