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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

num function add +- before the number

Hi All,

I using the num() function in a text object and I would like to add + or - according to the calculation result. The expression is a trend current period in comparison to previous period.

I tried several options including '+#,###' and +'#,###'which didn't work.

Any ideas?

Thx!

Hila.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

=num(MyNum,'+#,##0;-#,##0')

View solution in original post

6 Replies
maxgro
MVP
MVP

=num(MyNum,'+#,##0;-#,##0')

Anonymous
Not applicable
Author

Or even just like this for little less typing :

=num(MyNum,'+#,##0')

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this using Num()

Syntax: Num(Number, 'Positive Number format;Negative Number format')

Example:

num(-10000,'+#,##0;-#,##0') - Output: -10,000

num(10000,'+#,##0;-#,##0') - Output: 10,000

Hope this helps you.

Regards,

Jagan.

its_anandrjs
Champion III
Champion III

On text box try like below expression


=if( Sum( YourMetricHere ) <= 0, '-', '+' ) & Fabs( Sum ( YourMetricHere ) )

Not applicable
Author

Thx Massimo Grossi! this works great!

Not applicable
Author

Hi Jegan,

I wanted to display +1000 for positive and -1000 for negative. See the marked correct answer for the syntax.

Thanks for your help!