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

qliksense KPI one decimal

Hello All,

I am using Simple KPI Extension and Standard Qliksense #1 KPI object to display Total Sales. Simple KPI Shows  values such 35M, 30K, etc Standard KPI shows 35.41M, 30.33K etc. what I am looking is Values such as 35.4M, 30.3K with decimal values, can you please help on this.

Thanks

Raj

11 Replies
nakul1001
Not applicable

Re: qliksense KPI one decimal

You probably might have tried this already but want to check anyway:  What happens when you select Number formatting as 'Custom' (instead of auto) and in the Format pattern text box  use this : "#,##0.0".

Not applicable

Re: qliksense KPI one decimal

Hello Nakul,

When I change to custom format to as you mentioned, then values displays completely like 30,300,167.99. but I would like to see 30.3M that is way I am using custom formula based on Rob formula which is given below again.

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

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

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

));


then use expression $(vScaleNumber(sum(InvoiceValue)))

this code is working fine without decimals. but I wanted with 1 decimal.

Raj

nakul1001
Not applicable

Re: qliksense KPI one decimal

what happens when you change the formula to this:

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

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

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

));

kidbank3
Not applicable

Re: qliksense KPI one decimal

Raju,

Is this what you are trying to achieve?

This was accomplished with Gysbert's previous answer:

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

     ) & ''

My new sheet (1) _ Sheets - Qlik Sen.jpg

Not applicable

Re: qliksense KPI one decimal

Hello Michael,

Yes, this is what I wanted, thank you and Gysbert. This is working fine and this is correct Answer for Dynamic KPI values for 1 decimal.

Thanks

Raj

rhohagen
Not applicable

Re: qliksense KPI one decimal

Hello Michael,

That expression worked fine in a Table, but in a Line Chart it is not working, it doesn't show anything. Can you help me with that?

Thanks!

kidbank3
Not applicable

Re: qliksense KPI one decimal

Have you tried just doing the expression without the formatting?  Using the example above it would just be sum(Sales).  A line chart should format as needed.

kidbank3
Not applicable

Re: qliksense KPI one decimal

Untitled.png

rhohagen
Not applicable

Re: qliksense KPI one decimal

Hello Michael,

What I want is to have the auto number formatting (K, M, G) but with just 1 decimal. Using the expression in a table gives me the format I want with just 1 decimal, but in a bar or line chart it does not work, it shows nothing.