Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I proposed some workarounds at your post in the QlikBug
Strange num() Format Code behavior
- Ralf
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
I guess format like: '+#.##0' alone works fine unless you need zero with '+/-' prefix.
=num(10, '+#.##0; -#.##0')
=num(-10, '+#.##0; -#.##0')
=num(0, '+#.##0; -#.##0')
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
use the
Formate Code to identify : '+(#.##0); -(#.##0); +/-0'
these make sense that Positive or Negative values Easily
Thanks Sunil, but your code is pretty the same - it doesn't work either...
Result for negative value: -(+10)
It strikes me as a bug. If there is any "+" in the third pattern, the "+" shows up in in the negative value.
-Rob
I proposed some workarounds at your post in the QlikBug
Strange num() Format Code behavior
- Ralf