Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Colors written in expression

Hello,

I have the following formular running to get a "delay" and "in time" result:

=if(
( NetWorkDays( ( E_WE_Pos.c_Liefertermin), (E_WE_Pos.c_WE_Datum))-1) >2 ,
  'delay', 'in time' )

Its working fine but now I want to have the word "delay" written in RED and "in time" written in GREEN color. Could someone help me if there is an easy way to include the colors directly in the code that I get the result promplty?

Thx & regards

Heiko

5 Replies
swuehl
MVP
MVP

As expression for text coloring (in properties of your table chart for your expression), use something like

=if( ( NetWorkDays( ( E_WE_Pos.c_Liefertermin), (E_WE_Pos.c_WE_Datum))-1) >2 ,

Lightred(),

Lightgreen()

)

Not applicable
Author

Hello,

thx for your infirmation. I guess it doesn't give me the result. I understood that this expression works fine if I use that to format a dimension directly.

Th idea is to implement the color directly in the expression that the result comes back in the requested color like:

=if(( NetWorkDays( ( E_WE_Pos.c_Liefertermin), (E_WE_Pos.c_WE_Datum))-1) >2 ,

         red()  'delay',

         green() 'in time'  )

I tried the a.m. version but it doesn't work in theis direction.

Heiko

swuehl
MVP
MVP

Have you tried setting the text color expression within your expression properties section in properties panel of your QlikSense table chart?

TextColorSense.png

nizamsha
Specialist II
Specialist II

In  Table ,under the measure  in that you have the option Background Color Expression

if( ( NetWorkDays( ( E_WE_Pos.c_Liefertermin), (E_WE_Pos.c_WE_Datum))-1) >2 ,

red(),

green()

)

Not applicable
Author

Hello ,

thx for the input. it works now.