Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

show -50 as (50)

Can any one please help me.

I have created one straight table their in expressions tab i wrote one expression like this

Sum({<year={2018}>}Sales) - Sum({<Year=(2017)}Sales) in Sales field their i got one negative value like -50.

Now i want to show this -50 as (50). Please help me to do this.

Labels (1)
7 Replies
sunny_talwar
MVP
MVP

May be this:

Num(Sum({<year={2018}>}Sales) - Sum({<Year={2017}>}Sales), '#,##0;(#,##0)')

andrespa
Specialist
Specialist

Hi, maybe you can use this one:

Fabs(Sum({<year={2018}>}Sales) - Sum({<Year=(2017)}Sales))

engishfaque
Specialist III
Specialist III

Dear Bhavvi,

Enclose your expression with Fabs() function, here is the way

=Fabs(Sum({<year={2018}>}Sales) - Sum({<Year=(2017)}Sales))

Kind regards,

Ishfaque Ahmed

HirisH_V7
Master
Master

Hi,

Check this,


From this,

LOAD * INLINE [

    Sales, Customer

    50, A

    -50, B

];

In the table expression,

Fabs-208457.PNG

If(Num(Sales)='##0',Sales,Num(Sales,'##0;(##0)'))

HTH,

Hirish

HirisH
jonathandienst
Partner - Champion III
Partner - Champion III

SunnyT's answer is correct, but you can also achieve that format in the chart properties Number tab. Select "Fixed" Enter the same format string #,##0;(#,##0) (match to your preferred thousands format and check it in the preview box.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avinashelite
MVP
MVP

you can also try like this

'('&fabs(Sum({<year={2018}>}Sales) - Sum({<Year=(2017)}Sales) )&')'

Chanty4u
MVP
MVP