Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
senpradip007
Specialist III
Specialist III

Num Format Issue

Hello Experts.

I have got stuck in a problem that may be easy to you. According to clients requirement, users decide the number format of the Num() function, i.e. if user inputs 2 the number format should be Num(10.12458, '#,###.##'). if user inputs 3 the number format should be Num(10.12458, '#,###.###').

Main challenge is to generate the Format Pattern.

Can any one help me? Thannks in advance.

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

=Num(10.12458, '#,###.' & Repeat('#',vInput) )

View solution in original post

3 Replies
nizamsha
Specialist II
Specialist II

=if(vInput=1, Num(10.12458, '#,##0'),

if(vInput=2, Num(10.12458, '#,##0.0'),

if(vInput=3, Num(10.12458, '#,##0.00'))))

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hi Pradip:

You need some variables

=Num(Sum(Quantity), $(NumberFormat_var), DecimalSep_var, ThousandSep_var)

and populate them with a expression based on the user input.

But ... not in all expressions and in all functions of the front end it works

anbu1984
Master III
Master III

=Num(10.12458, '#,###.' & Repeat('#',vInput) )