Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Background Color based on multiple fields or specific text

Hi Qliksperts!

I am trying to build a number of charts from which a storemanager can click on store X in chart 1 and then this store will be highlighted in all the other charts. This is working just fine with the background colour expression below:

=if(wildmatch(GetFieldSelections([StoreName]),'*'&only({1}[StoreName]) ) ,rgb(100,255,100))

However, some of the storenames are very similar (' XXX Webshop' and 'Webshop' as an example), and so several stores are highlighted because of the wildmatch search. Can i alter the expression above to search for the exact same text, hence not highlighting 'Webshop' when 'XXX Webshop' is being clicked on?

An alternative could be to make something like the below expression although i know the syntax wont work.. The StoreNumber is not unique (although it really ought to be) so i can't just use that.

=if(wildmatch(GetFieldSelections([StoreName]),'*'&only({1}[StoreName]) )

AND

wildmatch(GetFieldSelections([StoreNumber]),'*'&only({1}[StoreNumber]) )

,rgb(100,255,100))

Any good suggestions out there?

THANKS A LOT!

1 Solution

Accepted Solutions
Not applicable

Re: Background Color based on multiple fields or specific text

Thats the trick - dont actually know how i ended up with that expression in the first case. Simply by removing the only() i got the desired result... Not quiiite sure what/how/why but i'm a happy camper now

=if(wildmatch(GetFieldSelections([StoreName]),

//'*'&only({1}

[StoreName])

//)

,rgb(xxx,xxx,xxx))

Thx.

View solution in original post

6 Replies
Partner
Partner

Re: Background Color based on multiple fields or specific text

you can use match instead of wildmatch

Re: Background Color based on multiple fields or specific text

how is only working for you??? If StoreName has multiple rows of data, I would expect it to give null ( - ). When you put this in a text box object -> Only({1}StoreName) do you see value getting populated???

Not applicable

Re: Background Color based on multiple fields or specific text

Yeah, i usually don't forget important details but i can see i forgot one thing:

My Dimension is not just [StoreName], it is: StoreNumber & '-' & StoreName, so i really don't know the syntax for using the match function on this calculated dimension, so thats why i just went with the wildmatch, but now its an issue.

Thx

MVP & Luminary
MVP & Luminary

Re: Background Color based on multiple fields or specific text

Try =if(getselectedcount(StoreName) and max(match(StoreName,StoreName)),rgb(100,255,100))


talk is cheap, supply exceeds demand
Partner
Partner

Re: Background Color based on multiple fields or specific text

hi

look at the attach file

Not applicable

Re: Background Color based on multiple fields or specific text

Thats the trick - dont actually know how i ended up with that expression in the first case. Simply by removing the only() i got the desired result... Not quiiite sure what/how/why but i'm a happy camper now

=if(wildmatch(GetFieldSelections([StoreName]),

//'*'&only({1}

[StoreName])

//)

,rgb(xxx,xxx,xxx))

Thx.

View solution in original post