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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pennetzdorfer
Creator III
Creator III

Strange num() Format Code behavior

Hello,

I've noticed a strange issue when using format codes in num() function:

In my year-to-year comparison I would like to display "+" in front of positive values and "+/-0" for zero values ... that works well but for some reason all negative values get a "+-"

Does anyone have an idea why? Please find the attached qvw.

Thanks,

Florian

2014-04-14_113749.jpg

1 Solution

Accepted Solutions
rbecher
MVP
MVP

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf

Astrato.io Head of R&D

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

zero is considered positive so

=num(0, '+#.##0; -#.##0') is enough, if you need that format for zero use a condition:

if(myField = 0,

     num(0, '+#.##0; -#.##0; +/-0'),

     num(0, '+#.##0; -#.##0')

)

Hope it helps

tresesco
MVP
MVP

I guess format like: '+#.##0' alone works fine unless you need zero with '+/-' prefix.

nizamsha
Specialist II
Specialist II

=num(10, '+#.##0; -#.##0')

=num(-10, '+#.##0; -#.##0')

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

pennetzdorfer
Creator III
Creator III
Author

Thanks for your suggestions.

@ Allesandro: using an if-condition would be a workaround but I guess it should be possible using simple format codes

@ Tresesco: exactly, that's the problem (bug?!)  Using that format code in Excel works as intended.

Unfortunately I can't find anything in the Qlikview Manual ...

Any other ideas?

Regards,

Florian

sunilkumarqv
Specialist II
Specialist II

use the

Formate Code to identify : '+(#.##0); -(#.##0); +/-0'

these make sense that  Positive or Negative values Easily

pennetzdorfer
Creator III
Creator III
Author

Thanks Sunil, but your code is pretty the same - it doesn't work either...

Result for negative value:  -(+10)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It strikes me as a bug. If there is any "+" in the third pattern, the "+" shows up in in the negative value.

-Rob

rbecher
MVP
MVP

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf

Astrato.io Head of R&D