Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense KPI Number Format Auto

Hello All, this community  helped me lot by answering my questions or reading existing answers.

I am using KPI number format displaying with 1.22M which is correct with Auto Format, But I want display with one decimal format like 1.2M. if I change the format either Number or Custom ,  my KPI displaying complete KPI Values such as 1,222,200.97. How can is change format to display my KPI values as 1.2M without 2nd decimal and complete values.

I tried with Simply KPI extension and default Qliksense KPI object, but unable to display KPI values what I wanted.

Thanks

Raj

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Divide the value by 1000000 and then format that with 1 decimal and a M for millions:

comm214307.png


talk is cheap, supply exceeds demand

View solution in original post

11 Replies
Gysbert_Wassenaar

Divide the value by 1000000 and then format that with 1 decimal and a M for millions:

comm214307.png


talk is cheap, supply exceeds demand
Not applicable
Author

Hello Gysbert Wassenaar,

Thank you so much for your help.  Thanks Raj

Not applicable
Author

Hello Gysbert Wassenaar,

How about if the values random numbers like, Thousands, Mill, etc, can we make dynamic based on values?

Thanks

Raj

mgranillo
Specialist
Specialist

I also have this problem.  Hardcoding an "M" is too limiting.  Is there a way to make it dynamic?

Gysbert_Wassenaar

Try an expression like this one:

=pick(ceil(log10(sum(Sales))/3),

          num(sum(Sales),'#,##0.0'),

          num(sum(Sales)/1000,'#,##0.0 K'),

          num(sum(Sales)/1000000,'#,##0.0 M')

     ) & ''


talk is cheap, supply exceeds demand
Not applicable
Author

Hello All and Gysbert, I try to with you your expression with KPI object, but it is not displaying what I wanted, such as 34.2M or 23.3K etc, depending on values.

the following code Answered by Rob.

I am able apply below code for showing dynamic values with correct format, but I just need to add one decimal to values,  can you please check below code, and help me how to add decimal point from below code.

Thanks

Ram

I create a variable in the script like this:

SET vScaleNumber=if($1>1000000, num($1/1000000,'#,##0.000M')

,if($1>1000, num($1/1000,'#,##0.000K')

,num($1,'#,##0')

));

And then use it in expressions like this:

$(vScaleNumber(sum(InvoiceValue)))

mgranillo
Specialist
Specialist

Gysbert,

This is great, thank you.  I wrote something very similar but my expression did not work. 

What purpose does the ampersand and quotes serve after the pick function?

Thank you,

Mike

mgranillo
Specialist
Specialist

Raju,

Gysbert's expression works for me but only with the ampersand and quotes (& '').  Did you try with these characters added to your expression?

I asked Gysbert why these characters are required.

Mike

Gysbert_Wassenaar

It makes the result of the entire expression a string value so that Qlik Sense doesn't try to apply a numeric format to it.


talk is cheap, supply exceeds demand