Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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

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
Highlighted

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

Hi,

Try something like this

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

Regards

ASHFAQ

Highlighted

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

Hi,

Try something like this

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


Regards

ASHFAQ

Highlighted
Partner
Partner

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

you can start with fabs() function

Highlighted
Not applicable

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

fabs(-20)  =   20

Highlighted

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

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.
Highlighted

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

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

Highlighted
Specialist
Specialist

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

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