Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have created a variable : vSales = sum(Montant_Ventes)
This variable can go from 0 to Billions.
I have to use this variable in the title of a KPI but I want it to be displayed respecting the format below:
SET NumericalAbbreviation='3:k;6:M;9:Mds;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';
How can I do that?
You're correct. Numerical Abbreviations are utilized only when the variable serves as the value for the KPI and the format is set to "Automatic".
If you wish to display the value with the Numerical Abbreviation in the title, you'll need to reconstruct this function within the expression of the variable. It would look something like this:
//...
if([yourValue] >= 1000000, num([yourValue] /1000000, '#,## M'),
if([yourValue] >= 1000, num([yourValue] /1000, '#,## k'),
num([yourValue] , '#,##0')))
//...
You can extend the code to include additional numerical abbreviations.
The kpi formatting will follow the configuration made in main. You can configure the desired formatting in the main application.
If you need another alternative for formatting, I believe the solution in this topic can help you.
https://community.qlik.com/t5/App-Development/KPI-number-formatting/td-p/1736185
Att, Matheus
Hello @MatheusC ,
if I put sum(Montant_Ventes) in a measure, yes it follows the format configurated in main.
But my problem is with the variables, they don't follow the same format as configurated in main.
And I have to put sum(Montant_Ventes) in a variable to be able to use it in the title.
You're correct. Numerical Abbreviations are utilized only when the variable serves as the value for the KPI and the format is set to "Automatic".
If you wish to display the value with the Numerical Abbreviation in the title, you'll need to reconstruct this function within the expression of the variable. It would look something like this:
//...
if([yourValue] >= 1000000, num([yourValue] /1000000, '#,## M'),
if([yourValue] >= 1000, num([yourValue] /1000, '#,## k'),
num([yourValue] , '#,##0')))
//...
You can extend the code to include additional numerical abbreviations.
@clarachac
see the link I left above.
Greetings.