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: 
SK28
Creator
Creator

KPI Colour coding along with symbol colours

Hi

 

In KPI, I want to colour code the text and an Arrow symbol based On if condition.

If(count({<Month = {'current month'}>}ID) >=count({<Month = {'Previous month'}>}ID),

Count(id) & '⬆️', count(id) & '⬇️')

 

here if id count is  greater than or equal to previous month count, It should reflect as COUNT NUMBER IN GREEN & EVEN THE SYMBOL TO BE SHOWN AS GREEN

 

ELSE IN NUMBER IN RED & ARROW POINTING DOWN IN RED.

 

Can anyone help me on this.

1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi,

as in KPI, you only can 'color' numerical values, so you need to convert your expression to it using dual() function. So it could look like this:
if(count({<Month = {'current month'}>}id) >=count({<Month = {'Previous month'}>}id), dual(Count(id) & '▲', 1), dual(count(id) & '▼', -1))
(and set expressions Number formatting to 'Measure expression'). Basically, with dual you just show you count(id) and arrow, but numerical value of this will be 1 and minus 1 (true/false).
Now in tab Appearance -> Color, turn on Conditional colors and Add Limit, set it to 0, and colors for negative and positive values:

justISO_0-1676894880704.png

Other solution could be to still use dual() function in expression, but remove arrow symbols: ...dual(count(id), 1), dual(count(id), -1))

and add arrows or other symbols for true/false in Value selection step:

justISO_1-1676895128030.png

 

View solution in original post

1 Reply
justISO
Specialist
Specialist

Hi,

as in KPI, you only can 'color' numerical values, so you need to convert your expression to it using dual() function. So it could look like this:
if(count({<Month = {'current month'}>}id) >=count({<Month = {'Previous month'}>}id), dual(Count(id) & '▲', 1), dual(count(id) & '▼', -1))
(and set expressions Number formatting to 'Measure expression'). Basically, with dual you just show you count(id) and arrow, but numerical value of this will be 1 and minus 1 (true/false).
Now in tab Appearance -> Color, turn on Conditional colors and Add Limit, set it to 0, and colors for negative and positive values:

justISO_0-1676894880704.png

Other solution could be to still use dual() function in expression, but remove arrow symbols: ...dual(count(id), 1), dual(count(id), -1))

and add arrows or other symbols for true/false in Value selection step:

justISO_1-1676895128030.png