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

Display negative numbers in red color with Num() function

Hi,

as the object, I'd like to display negative numbers with red color using the num() function:

NUM(Value,'#.##0,0%;')

Sorry if it is a documented issue...i wasn't able to find it.

Thanks,

R.

8 Replies
Colin-Albert

this should work

NUM(Value,'#.##0,0%; -#,##0,0%')

gamaplast
Contributor III
Contributor III
Author

Sorry, it doesn't work:

=NUM(0.05,'#.##0,0%; -#,##0,0%')

Shows 5,0%

(OK)

NUM(-0.05,'#.##0,0%; -#,##0,0%')

Shows -5,000,0%

(NOT OK)

Thks.

R.

Colin-Albert

My mistake,

this should work

NUM(Value,'#.##0,0%; -#.##0,0%')

The wrong version has two commas, not a point and a comma


gamaplast
Contributor III
Contributor III
Author

Right, now it shows the numbers correctly, but it isn't red for the negative ones, as I wish...

Colin-Albert

You can use Visual Cues on the chart to set the colours.

visCues.JPG

gamaplast
Contributor III
Contributor III
Author

Sorry, I must use the Num() function 'cause I display the values in a text box...

Colin-Albert

In a text box, you can use a calculated colour on the Font Tab.

Click  "Color" on the font tab, then add the expression in the Calculated box and enable the Calculated option

col.JPG

gamaplast
Contributor III
Contributor III
Author

Ok, this time the workaround if fit for me 😉

Thanks a lot.

R.