Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text formatting

In the example attached I click a stop i want the value in the second row down to turn RED

The value in the box turns red if one is selected but goes off when another is selected which isnt what I want

If i chose say Market St (MKT) and Shudehill (SHU) I would want them both to remain RED


1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

use the following expression as calculated background color

for MKT text box,

if(GetFieldSelections(Stop) like '*MKT*',red())

similarly the other ones and modify as needed. red() can be replaced with your color of choice (even your color mix expression will work) and make sure you keep the two asterisks (*) inside the single quotes.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

use the following expression as calculated background color

for MKT text box,

if(GetFieldSelections(Stop) like '*MKT*',red())

similarly the other ones and modify as needed. red() can be replaced with your color of choice (even your color mix expression will work) and make sure you keep the two asterisks (*) inside the single quotes.

its_anandrjs

Hi,

Write like this in the text box for the text color

for VIC If(Match(Stop,'VIC'),LightRed()) 

for MKT If(Match(Stop,'MKT') or GetSelectedCount(Stop)=0,LightRed()) 

for SHU If(Match(Stop,'SHU') or GetSelectedCount(Stop)=0,LightRed()) 

Hope this helps

Thanks & Regards

Not applicable
Author

Thats great thanks. May I ask what the code would be if i wanted to add a second condition

ie if i wanted SPS to turn red when either SPS or MKT were selected

Te reason I ask this is that I want to add a line selection

Anonymous
Not applicable
Author


i'm sorry, i don't understand what you mean by second condition. could you elaborate?

but with the expression in my reply, it will work with multiple selections.

play with the conditions in the if statement if you need to add more conditions/requirements...

something like this should work for "if i wanted SPS to turn red when either SPS or MKT were selected":

for SPS text box,

if(GetFieldSelections(Stop) like '*MKT*' or GetFieldSelections(Stop) like '*SPS*',red())