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: 
robmarr789
Contributor
Contributor

conditional show expression based on listbox selection

I want to be able to conditionally display my expressions based on my list box selections. I've tried using wildmatch but can't get each expression to respond independently.

I want the following conditions to apply

Only 'Sales' selected = display only Sales expression

Only 'L12 Sales' selected = display only  'L12 Sales' expression

Both selected = show both selections

The opposite result for when they are not selected.

At the moment I'm struggling as when L12 Sales is selected/deselected both L12 Sales and Sales respond

In the future I have will have multiple selection options with 'sales' in the name. I will want all expressions to be controlled independently by one selection each only.

6 Replies
tresesco
MVP
MVP

Try below expressions


=WildMatch('@'&GetFieldSelections(subheader, '@')&'@','*@Sales@*')

=WildMatch('@'&GetFieldSelections(subheader, '@')&'@','*@L12 Sales@*')

robmarr789
Contributor
Contributor
Author

What does that mean?

tresesco
MVP
MVP

This is to put some extra character between values so that 'Sales' could be separated from a values like 'XXXSalesYYY'. Is it not working as desired for you?

robmarr789
Contributor
Contributor
Author

Brilliant that works. Any change you could explain the logic through each step?

Sorry I'm very new to QV

Nakosan
Contributor II
Contributor II

Hey, do you see what I'm doing wrong with combining WildMatch?

 

If(WildMatch(nativeCode, 1, 2, 3, ),'Minor severity'),

If(WildMatch(nativeCode, 4, 5, 8, ),'Medium severity'),

If(WildMatch(nativeCode, 7, 6, 9, ),'Critical'),

Have tried with = instead of If, also some other expressions... Shouldn't be too hard but been stuck on this for a while now.

tresesco
MVP
MVP

Hi @Nakosan ,

It could be the nesting structure issue. Try instead like (note the bracket changes):

If(WildMatch(nativeCode, 1, 2, 3, ),'Minor severity',

If(WildMatch(nativeCode, 4, 5, 8, ),'Medium severity',

If(WildMatch(nativeCode, 7, 6, 9, ),'Critical')))