Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Need to convert Negative values to positive values with[ ] and red font

Hi Friends,

How to show negative values to positive values within [  ] and red color font.Please anyone can suggest me how to achieve it.

Regards

Krishna

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

HI,

Check this

I add reply but its under moderation don't know why.

Check the attached File and let me know if that worked.

Regards

ASHFAQ

View solution in original post

7 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Try something like this

=if(YourExpression<0,chr(91)&fabs(YourExpression)&chr(93),YourExpression)

Regards

ASHFAQ

ashfaq_haseeb
Champion III
Champion III

Hi,

Try something like this

if(YourExpression<0,chr(91)&fabs(YourExpression)&chr(93),YourExpression)


Regards

ASHFAQ

jpenuliar
Partner - Specialist III
Partner - Specialist III

you can start with fabs() function

Not applicable

fabs(-20)  =   20

PrashantSangle

Hi,

Use num()

try like

num(value,'#,##0.00;[#,##0.00]')

and

For red font click on + symbol -> go to text color->write if(value<0,RED())

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
ashfaq_haseeb
Champion III
Champion III

HI,

Check this

I add reply but its under moderation don't know why.

Check the attached File and let me know if that worked.

Regards

ASHFAQ

Anonymous
Not applicable

Hi

try like this

Test:

LOAD * INLINE [

    City, Amount

    Berlin, -100

    Zurich, 200

];

create a straight table in expression write  fabs(sum(Amount))

and in background color write if(sum(Amount)<0,red())

hope this will help you

thanks