Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Font Colour within Concat expression

Hi,

I have the following expression : concat(distinct name, ', ')

Is it possible to set the colour of each 'name' when it is displayed depending on a condition.  For Example if the expression lists : Name1, Name2, Name3

could I turn the colour of Name2 to Red if a variable 'vNumber' is less than 'Target' ?

Many thanks

5 Replies
Gysbert_Wassenaar

Yes, click on the + in front of the expression and select Text Color. You can then enter an expression in the Definition field: if(vNumber<Target, red())

If that didn't work we need more information. Please post a sample document:

Preparing examples for Upload - Reduction and Data Scrambling.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi thanks for your reply.

What I am trying to acheive is this  :

concat_required_look.png

But by using your example - the whole 'cell' text has turned one colour or another.  Please see attached file.

Many thanks again.

Gysbert_Wassenaar

No, that's not possible. The concatenated string is only one string, only one value. That's why it can have only one background or text color.


talk is cheap, supply exceeds demand
Not applicable
Author

I thought so - is there another way of showing this (eg, in seperate cells)?

Gysbert_Wassenaar

Yes, with each value in a separate cell you can give each value its own color. In your sample document you will need to select only one month. Or you have to change the if condition because for each target-name combination there are months where Number < Target and months where Number > Target. And one cell can't have two colors at once so you'll have to make sure there's no ambiguity.


talk is cheap, supply exceeds demand