Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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 & Luminary
MVP & Luminary

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf

Vizlib Head of R&D

View solution in original post

8 Replies
alexandros17

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

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

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

Result for negative value:  -(+10)

rwunderlich
MVP & Luminary
MVP & Luminary

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 & Luminary
MVP & Luminary

I proposed some workarounds at your post in the QlikBug

Strange num() Format Code behavior

- Ralf

Vizlib Head of R&D

View solution in original post