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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
rdsuperlike
Creator
Creator

Display negative results

Want to display -123 as (123) in expressions

Example:

if ((sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k))) < 0

then i want to display (14000) instead of -14000

Any help is appreciated

18 Replies
rdsuperlike
Creator
Creator
Author

It gives same value. It doesnt give brackets accross negative value.

I want (14000) if the value is -14000

petter
Partner - Champion III
Partner - Champion III

How is your PC set up with National Language settings? US or some other number formatting?

santhoo_san
Partner - Creator II
Partner - Creator II

Under number tab of the chart properties, select expression default to give effect of the num function explained by the other friends, or select integer / fixed to and update  # ##0;(# ##0) in the Format pattern.

rdsuperlike
Creator
Creator
Author

US

petter
Partner - Champion III
Partner - Champion III

Then it is a mystery to me why you can't get this simple thing to work ...

Anonymous
Not applicable

It certainly works...

MarcoWedel

Hi,

another sample application:

QlikCommunity_Thread_163327_Pic1.JPG

using this sample data:

QlikCommunity_Thread_163327_Pic2.JPG

I reduced

(sum(x) + sum(y) +sum(z)) - (sum(x) + sum(y) +sum(k))

to

sum(z)-sum(k)

as it should be equivalent.


IMO petter-s‌ approach, defining a format string, is the most straight forward and elegant solution to your problem.

hope this helps

regards

Marco

rdsuperlike
Creator
Creator
Author

It works for the example that Michael Solomovich showed.

But it didnt work for my expression.

here is what I did

Num(  RangeSum(Before((sum(P_QTY) + sum(D_QTY) +sum(ND_QTY))

-

(sum(P_QTY)+ sum(D_QTY) +

SUM(IP_QTY-WIP_QTY) + IF(GetSelectedCount(ITEM_NAME)>0, SUM(IP_QTY)*MAX(SPLIT_PCNT),SUM(IP_QTY))

+ Sum(O_QTY)  + SUM(O_QTY)),0,ColumnNo())) ,  '0;(0)'  )

I think I am messing up bcz of the long expression.

Anonymous
Not applicable

First, see if the expression works without formatting.

If it doesn't, fix it first.  If it does, add formatting:

num(<your long expression>, '#,##0;(#,##0)')