Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Coloring Text

Please how do I color my text like the code below.

if(Sum(Actual) >= Sum(Target) ,

Red(FILLED UP), Green(NOT FULL)
)

22 Replies
Anonymous
Not applicable
Author

Not applicable
Author

This works if the outcome of your expression is a value. My outcome in this case is Text not integer/value.

Not applicable
Author

Try using this extension.

You can change your title colour as well as its background colour based on some expression.

GitHub - stefanwalther/sense-themable-kpi-tile: Qlik Sense Extension: KPI Tile with the ability to u...

Hope this is what you are looking for.

Regards,

Rohan

Colin-Albert
Partner - Champion
Partner - Champion

Can you use  dual in your KPI expression?

Something like   if(Sum(Actual) >= Sum(Target) , dual('Green', 1), dual('Red', 0)

This will allow you to use a conditional colour as the expression result is numeric, but will display the text Green or Red

Anonymous
Not applicable
Author

Hi Can you share your expression I have used the Text & Image to change the colour of the text as well as measure..

screen shot below:

Not applicable
Author

Look at my code segment again:

if(Sum(Actual) >= Sum(Target) ,

Red(FILLED UP), Green(NOT FULL)
)

If Actual >= show Text FILLED UP in (Red color);

If Target > show Text NOT FULL in (Green color)

Colin-Albert
Partner - Champion
Partner - Champion

You just need to interpret the answers given here.  Its only changing the text on the dual expressions.

Try this        if(Sum(Actual) >= Sum(Target) , dual('FILLED UP', 1), dual('NOT FULL', 0) )

Then alter the Conditional Colours on your KPI object for the upper and lower limit.

SenseConditionalColour2.PNG

Not applicable
Author

No Colin. I tried this previously. See what am talking about in screenshot. My expression passes Text as output not integer. Sense flags Text output on conditional colors as error

AA.JPG

Colin-Albert
Partner - Champion
Partner - Champion

You are right, the KPI object will only display the numeric value of a dual field.

You can show text in a KPI object, but if the field is dual only the numeric part is displayed/

I have tried a chart with a measure and no dimensions but Sense will not display the object unless a dummy dimension is added.

It looks like you will need an extension object to achieve your requirement or perhaps Sense 3.0 will have this functionality?

Colin-Albert
Partner - Champion
Partner - Champion

This extension may work for you. I have not used it myself.

Editable TextBox    Qlik Branch