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.
bdroesch
New Contributor

How do I display "$" sign in KPI object and also use Numerical Abbreviations ("K", "M", "B"...)

Hi,

I am showing a KPI for a monetary field where I want to show it with a numerical abbreviation. For example, 1.5B instead of 1,500,000,000. I added the following statement to my load script to set 10^9 as "B".

SET NumericalAbbreviation = '3:k;6:M;9:B;12:T;15Smiley Tongue;18:E;21:Z;24:Y;-3:m;-6:µ;-9:n;-12Smiley Tongue;-15:f;-18:a;-21:z;-24:y';

This works when I set the formatting to "Auto" but I want to add a "$" to the beginning of this value.  How would I do this? If I change the format to MONEY then I lose the abbreviation.

I imagine there is a way to do this with setting a Custom formatting. Please let me know if there are any such solutions.

Thank you,

Brian

2 Replies
mikaelsc
Contributor III

Re: How do I display "$" sign in KPI object and also use Numerical Abbreviations ("K", "M", "B"...)

Quy_Nguyen
Contributor III

Re: How do I display "$" sign in KPI object and also use Numerical Abbreviations ("K", "M", "B"...)

1. Create a variable in your load data script:

SET format_Number =  Num($1/ RangeMin(Pow(10, ((Ceil(Len(Round($1, 1))/3, 1) - 1) * 3)), 1000000000), $2 & '#,##0.00' & Pick(RangeMin(Ceil(Len(Round($1, 1))/3, 1), 4), '', 'K', 'M', 'B'));

2. In your KPI object, create measure like:

$(format_Number(1000000000, '$'))

Just replace 1000000000 by your measure.

Source: gbillions and gbillions: changing default numeric abbreviations in Qlik Sense