Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Highlighted
Specialist III
Specialist III

Hi,

can you attach sample working file.

Thanks,

Mukram

Highlighted
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

Highlighted
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

Highlighted
Partner
Partner

Great response.

Highlighted
Creator
Creator

Hi Luis,

Excellent explanation.

Thanks,

S K