Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Custom number format with variable

I have expression

     Num((Sum({$<QUARTER = {99}>} jATTRIBUTE_VALUE)/1000000), '#,##0.00;(#,##0.00)')
But instead of two decimal, I want option to select how many decimal end user wants. So I applied as below in red

    Num

((Sum({$<QUARTER = {99}>} jATTRIBUTE_VALUE

)/1000000), '$(=vDivision)')  Where vDivision is variable and value for this is

#,##0.00;(#,##0.00)

But it does not work

Is there any way to apply variable

Thanks in advance

1 Solution

Accepted Solutions
NadiaB
Support
Support

Hi @Anonymous 

I just tested and it works fine:

Variable Value (vFormat sample variable):

#,##0.0000;(#,##0.0000)

Expression:

=Num( 12345670000, '$(vFormat)')

 

Kind Regards,

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm

View solution in original post

6 Replies
Not applicable
Author

Hi Satish,

if the variable is just set like that you don't need to dollar expand it, just use.

you only would need to dollar expand if the variable contained an expression and you wanted to use the result from it.

((Sum({$<QUARTER = {99}>} jATTRIBUTE_VALUE

)/1000000), vDivision)

hope that helps

Joe

Anonymous
Not applicable
Author

Hi Joe

I used as below

((

Sum({$<QUARTER = {99}>} jATTRIBUTE_VALUE

)/1000000), 'vDivision')  where vDivision is

'#,##0.00;(#,##0.00)' is variable

I am not getting required result but all zeroes. Am I making any mistake here?

Thanks for your time and follow up.

Anonymous
Not applicable
Author

No quotes needed:

num(<expression>, vDivision)

Anonymous
Not applicable
Author

Thanks Michael & Joe for your valuable suggestion

Not applicable
Author

Yea as Michael says no quotes, I missed taking the second one away in my post sorry, have edited now

NadiaB
Support
Support

Hi @Anonymous 

I just tested and it works fine:

Variable Value (vFormat sample variable):

#,##0.0000;(#,##0.0000)

Expression:

=Num( 12345670000, '$(vFormat)')

 

Kind Regards,

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm