Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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())
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
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
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())
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
It worked without adding not even a comma! Thanks very much!!!
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.