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: 
makximenkoa
Contributor III
Contributor III

Using Selections on Multiple Fields to Show/Hide Object

Hello,

I am attempting to use wildmatch and the getcurrentselections functions together to conditionally show/hide an object. The goal would be that if a selection was made on any field other than the ones below, an object is shown

Here is the equation I am attempting to use for the conditional show/hide (from the discussion here):

=if(Wildmatch(GetCurrentSelections(), $(=concat({< [$Field] =-{'[Discharge Department]','[MonthAbvYear]','[Attending Provider]', '[Location]'}>} chr(39) & '*' & [$Field] & '*' & chr(39),',')) )>=1,1,0)

The goal would be that if a selection was made on any field other than the ones above, an object is shown. It works fine for the Attending Provider and Location fields but for some reason does not work on the Discharge Department or MonthAbvYear fields. There are no differences between the 4 fields that I can tell that would cause them to behave differently. When I input just the '=concat(...)' function into a text object, the concatenated text looks correct. Maybe there's something going on with the wildmatch component?

Any help would be greatly appreciated!

Message was edited by: Al Makximenko

1 Solution

Accepted Solutions
sunny_talwar

Try this

=if(Wildmatch('|' & GetCurrentSelections(', |', '|:'),    $(=concat({< $Field -= {'Attending Provider','Location','Discharge Department','MonthAbvYear'}>} chr(39) & '*|' & $Field & '|*' & chr(39) ,',')))>=1,1,0)

View solution in original post

8 Replies
sunny_talwar

Do you really need the square brackets around your fields? Have you tried this?

=WildMatch(GetCurrentSelections(), $(=Concat({<[$Field] =-{'Discharge Department', 'MonthAbvYear', 'Attending Provider', 'Location'}>} Chr(39) & '*' & [$Field] & '*' & Chr(39), ',')))

or this

=If(WildMatch(GetCurrentSelections(), $(=Concat({<[$Field] =-{'Discharge Department', 'MonthAbvYear', 'Attending Provider', 'Location'}>} Chr(39) & '*' & [$Field] & '*' & Chr(39), ',')))>=1, 1, 0)

makximenkoa
Contributor III
Contributor III
Author

Thank you for the reply. Yes, I've tried with the brackets and without but unfortunately I get the same results either way.

sunny_talwar

How about this

=WildMatch(GetCurrentSelections('|', ': ', ',', 500000), $(=Concat({<[$Field] =-{'Discharge Department', 'MonthAbvYear', 'Attending Provider', 'Location'}>} Chr(39) & '*' & [$Field] & '*' & Chr(39), ',')))

or this

=If(WildMatch(GetCurrentSelections('|', ': ', ',', 500000), $(=Concat({<[$Field] =-{'Discharge Department', 'MonthAbvYear', 'Attending Provider', 'Location'}>} Chr(39) & '*' & [$Field] & '*' & Chr(39), ',')))>=1, 1, 0)

makximenkoa
Contributor III
Contributor III
Author

I tried the above and am still getting the same results.

sunny_talwar

Would it be possible to share a sample where you can replicate your issue?

makximenkoa
Contributor III
Contributor III
Author

I've attached a sample above.

sunny_talwar

Try this

=if(Wildmatch('|' & GetCurrentSelections(', |', '|:'),    $(=concat({< $Field -= {'Attending Provider','Location','Discharge Department','MonthAbvYear'}>} chr(39) & '*|' & $Field & '|*' & chr(39) ,',')))>=1,1,0)

makximenkoa
Contributor III
Contributor III
Author

Works like a charm, thank you!