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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gpedacci
Partner - Contributor II
Partner - Contributor II

Exact Match for a list

Hi, I created a button use to apply a bookmark. This bookmark select 3 options of a list (see below). Now I am working to change the background color when those three options are selected, but is not working...I need to use one colour when the exact seleection is used and another when any other selection is applied...I triend GetField Selection but looks like work for only one field...i also tried the below code but work for any of the selections, not only when the three if them are selected...

=if(Match([AE.Cargo],'Post DT','Director','Responsable Oficina'), '#26a0a7', 'lightgray')

 Any help? Regards

gpedacci_0-1676731393510.png

 

Labels (3)
1 Solution

Accepted Solutions
henrikalmen
Specialist II
Specialist II

You say you tried using the GetFieldSelections functions, but didn't get it right. But it should work - how did you do it? I'm thinking this ought to work, although I haven't tried it:

if(match(GetFieldSelections([AE.Cargo],'|',3), 'Director|Post DT|Responsable Oficina'), rgb(38,160,167), lightgray())

 

View solution in original post

6 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Count({<[AE.Cargo]={'Post DT','Director','Responsable Oficina'}>} DISTINCT [AE.Cargo])

will get you a count of how many match. So something like:

if(
Count({<[AE.Cargo]={'Post DT','Director','Responsable Oficina'}>} DISTINCT [AE.Cargo]) = 3, 'color1'
,if(
Count({<[AE.Cargo]={'Post DT','Director','Responsable Oficina'}>} DISTINCT [AE.Cargo]) > 0, 'color2'
))

 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

gpedacci
Partner - Contributor II
Partner - Contributor II
Author

Thanks for the reply, Rob....but still not working

I want the syntax to check if Multiple values are selected in filter, i.e by using if condition with GetFieldSelections  or GetSelectedCount

 

henrikalmen
Specialist II
Specialist II

You say you tried using the GetFieldSelections functions, but didn't get it right. But it should work - how did you do it? I'm thinking this ought to work, although I haven't tried it:

if(match(GetFieldSelections([AE.Cargo],'|',3), 'Director|Post DT|Responsable Oficina'), rgb(38,160,167), lightgray())

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Doesn't look like I was thinking very clearly! Looks like @henrikalmen suggestion should work. Although I think you could just use "=", no need for Match. 

-Rob

gpedacci
Partner - Contributor II
Partner - Contributor II
Author

It worked without adding not even a comma! Thanks very much!!!

henrikalmen
Specialist II
Specialist II

Yes of course, enclosing in match() is unnecessary in this case. It only makes sense if you have other combinations of selections in the same field that should result in other colours.