Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
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
MVP & Luminary
MVP & Luminary

Re: Qlik Sense KPI Number Format Auto

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
11 Replies
MVP & Luminary
MVP & Luminary

Re: Qlik Sense KPI Number Format Auto

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

Re: Qlik Sense KPI Number Format Auto

Hello Gysbert Wassenaar,

Thank you so much for your help.  Thanks Raj

Not applicable

Re: Qlik Sense KPI Number Format Auto

Hello Gysbert Wassenaar,

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

Thanks

Raj

kidbank3
Contributor III

Re: Qlik Sense KPI Number Format Auto

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

MVP & Luminary
MVP & Luminary

Re: Qlik Sense KPI Number Format Auto

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

Re: Qlik Sense KPI Number Format Auto

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)))

kidbank3
Contributor III

Re: Qlik Sense KPI Number Format Auto

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

kidbank3
Contributor III

Re: Qlik Sense KPI Number Format Auto

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

MVP & Luminary
MVP & Luminary

Re: Qlik Sense KPI Number Format Auto

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