11 Replies Latest reply: Oct 23, 2017 3:44 PM by Renzo Hohagen

# 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

• ###### 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".

• ###### 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

• ###### 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')

));

• ###### 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')

) & ''

• ###### 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

• ###### 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!

• ###### 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.

• ###### 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.

• ###### Re: qliksense KPI one decimal

Renzo,

There's nothing I can recommend to get this to work.  You're likely not getting a result because the expression above passes a text result and a chart will be looking for a numeric.

You could try re-asking the question in the community and see what other users say.

Mike

• ###### Re: qliksense KPI one decimal

Thanks Michael for your help!