Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
pennetzdorfer
Contributor 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
MVP & Luminary
MVP & Luminary

Re: Strange num() Format Code behavior

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf

8 Replies

Re: Strange num() Format Code behavior

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

MVP
MVP

Re: Strange num() Format Code behavior

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

nizamsha
Valued Contributor II

Re: Strange num() Format Code behavior

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

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

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

pennetzdorfer
Contributor III

Re: Strange num() Format Code behavior

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
Valued Contributor II

Re: Strange num() Format Code behavior

use the

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

these make sense that  Positive or Negative values Easily

pennetzdorfer
Contributor III

Re: Strange num() Format Code behavior

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

Result for negative value:  -(+10)

MVP & Luminary
MVP & Luminary

Re: Strange num() Format Code behavior

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

-Rob

MVP & Luminary
MVP & Luminary

Re: Strange num() Format Code behavior

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf