Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

'[]' in number format

I want to display like this:

[+5.1%]

[-2.4%]

thefore I tried below:

(1)  Num( x, '+0.0%; -0.0%') 

(2)  Num( x, '[+0.0%]; [-0.0%]')

Of course (1) was successful.

but  (2)  failed.

I can't use (3),(4):

(3)  '[' & Num( x, '+0.0%; -0.0%')  & ']'


because (3) is not smart when x is null.


(4) if( isnull(x), null(), '[' & Num( x, '+0.0%; -0.0%')  & ']')

because the x is actuary very long formula.

Please advise me.

1 Solution

Accepted Solutions
prieper
Master II
Master II

Seems that QV has slight problems in mixing brackets [] with %.

Enter an expression and fill in the required formatting by hand

HTH

Peter

View solution in original post

5 Replies
olivierrobin
Specialist III
Specialist III

hello

i tried

num(_evolution,'[+ ##0%];[- ##0%;0%]')

and it works

joseph_eftamand
Partner - Creator
Partner - Creator

What about this:


if( len(x) > 0, '[' & Num( x, '+0.0%; -0.0%')  & ']', null())

prieper
Master II
Master II

Seems that QV has slight problems in mixing brackets [] with %.

Enter an expression and fill in the required formatting by hand

HTH

Peter

Anonymous
Not applicable
Author

thanks Olivier, Joseph, and Peter,


Olivier, for example:


Num(0.1234, '[+ ##0.00%]')


It return [+ 0.12%].

We expect [+ 12.34%].


As Peter says, It seems Qv's problem

or specification of format specifier.


Joseph's formula use x 2 times.

because x is very long formula,

I want to avoid it if possible.


Peter's method is interesting.

prieper
Master II
Master II

suggest to check your spelling,

here it works and delivers correct formatting:

The problem with QV seems, that you are not able to copy this formatting to another expression, but you need to enter the formatting string by hand for each expression ...

Peter