Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Font color and style for Expression Column value

Hi,

I have sum(Amounts) column as a Expression. My requirement is,

if sum(Amounts) has negative value , that negative value should be Red Color and that negative value in brackets like ( ).

How can i achieve this, could you please tell me Set expression and process

Thanks,

MLNR

13 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Use this as expression

=Num(Sum(Sales), '#,##0.00;(#,##0.00)')

and in number table select Expression Default option.

and for background color expand + sign of the expression and click on Background and give below expression

=If(Sum(Sales) > 0, RGB(255, 0, 0))

Hope this helps you.

Regards,

Jagan.

senpradip007
Specialist III
Specialist III

Try this

if(sum(Amounts) >=0, sum(Amounts), '(' & sum(Amounts) &')' )

Expend expressions and write the following expression "Background Color" section for background

if(sum(Amounts) <0, red(), black())

Not applicable
Author

Hi Jagan,

Thi expression is ok. But I want , negative number color is in red and negative number should be in brackets like ( ).

Thanks

MLNR

Not applicable
Author

Hi Pradip,

Thi expression is ok. But I want , negative number color is in red and negative number should be in brackets like ( ).

Thanks

MLNR

sunilkumarqv
Specialist II
Specialist II

Make use Expression as Num(sum(Amount),'#,##.#;(#,##.#) ; '))

and then go to + sign background expression

IF(Sign(Amount)='-1',Red())

senpradip007
Specialist III
Specialist III

Have you tried it?

jagan
Luminary Alumni
Luminary Alumni

Hi,

For coloring try like this

For Text color expand + sign of the expression and click on Text Color and give below expression

=If(Sum(Sales) > 0, RGB(255, 0, 0))

Regards,

Jagan.

senpradip007
Specialist III
Specialist III

Have a look on the attachment.

Anonymous
Not applicable
Author

Hi Narayana ,

Pradip Sen suggested is working