Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
kicchu465
Creator
Creator

To display Positive and Negative Signs in KPI Object

Hi All,

I have requirement as below.

To populate positive and negative values like +1.1% or -2.5% and apply the colour Green for Positive values and Red for negative values using KPI Object in qlik Sense

The meaure I have used.

Num(Num($(Field1%)-$(Field2),'#,##0.0%'),'+#,##0.0%')

By appying the above I can the acheive the result but I am unable to display the '+' & '-' sign.

I have then Used Num(Num($(Field1%)-$(Field2),'#,##0.0%'),'+#,##0.0%') & Chr(10),By using this I can display the display the '+' & '-' but I am unable to Set the colours under Colour Tab.

The message shows "There is some error in the expression".

Is there any alternate to acheive this??

Thanks

SK

1 Solution

Accepted Solutions
luismadriz
Specialist
Specialist

Hi,

KPI objects allow you to set colours and formats in the properties.

Select Custom format and type:

+#,##0.0%;-#,##0.0%

Then go to Appearance, turn Conditional Colours On and add a limit, type 0, click on the left colour and select Red, then click on the right colour and select Green. It should be something like this:

Untitled.png

Your KPIs should look like this for example:

Untitled.png

Instead of Selecting Custom formatting and specifying the format I've shown before you could've also set the format to Auto and have num with something like this:

=Num(aggregation(calculations),'+#,##0.0%;-#,##0.0%')

KPI Objects don't have the Background and Foreground colour expressions that other objects have, a table for example, in which you could've done this:

Untitled.png

In which I've set the colour in the background to something like:

=If(aggregation(calculations)>=0,Green(),Red())

I hope his helps,


Cheers,


Luis

View solution in original post

5 Replies
mdmukramali
Specialist III
Specialist III

Hi,

can you attach sample working file.

Thanks,

Mukram

devarasu07
Master II
Master II

Hi,

Have you tried like this?

if(Num(Num($(Field1%)-$(Field2),'#,##0.0%'),'+#,##0.0%') & Chr(10) >0, Green(),red())

also u can try to use this simple table KPI extension.

Qlik Branch

Thanks,
Deva

luismadriz
Specialist
Specialist

Hi,

KPI objects allow you to set colours and formats in the properties.

Select Custom format and type:

+#,##0.0%;-#,##0.0%

Then go to Appearance, turn Conditional Colours On and add a limit, type 0, click on the left colour and select Red, then click on the right colour and select Green. It should be something like this:

Untitled.png

Your KPIs should look like this for example:

Untitled.png

Instead of Selecting Custom formatting and specifying the format I've shown before you could've also set the format to Auto and have num with something like this:

=Num(aggregation(calculations),'+#,##0.0%;-#,##0.0%')

KPI Objects don't have the Background and Foreground colour expressions that other objects have, a table for example, in which you could've done this:

Untitled.png

In which I've set the colour in the background to something like:

=If(aggregation(calculations)>=0,Green(),Red())

I hope his helps,


Cheers,


Luis

bwisealiahmad
Partner - Specialist
Partner - Specialist

Great response.

kicchu465
Creator
Creator
Author

Hi Luis,

Excellent explanation.

Thanks,

S K