Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Divide the value by 1000000 and then format that with 1 decimal and a M for millions:
Divide the value by 1000000 and then format that with 1 decimal and a M for millions:
Hello Gysbert Wassenaar,
Thank you so much for your help. Thanks Raj
Hello Gysbert Wassenaar,
How about if the values random numbers like, Thousands, Mill, etc, can we make dynamic based on values?
Thanks
Raj
I also have this problem. Hardcoding an "M" is too limiting. Is there a way to make it dynamic?
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')
) & ''
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)))
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
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
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.