Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the below expression to prefix a KPI with $ symbol, but $ is not added as expected. Any help is appreciated.
='$ ' & [MEASURE] - result is same as [MEASURE]
='$abc ' & [MEASURE] - result is $abc [MEASURE]
num([MEASURE],'$ # ##0,00')
or
num([MEASURE],'$ #,##0.00')
and set the format to "Measurement Expression"
- Regards, Matheus
As @MatheusC suggested you could use money number format.
Main question is: what are you trying to achieve? What you are showing should work if you use correct settings. The reason this does not work for you is that likely you already have other format set on the measure as presented below:
When I use money number format, the large amount is not showing in the shortened form (billions, millions etc.) I know I can use some if conditions to achieve it, but dont want use any formulas because I am dealing with a large data set.
In this case you may need to use if() condition.
I understand that you may be working with large data volume but it does not mean your If() has to be slow. Yes there will be little bit of overhead but It all depends how you write the formula. Since we are just interested in format calculation your "If" will not have any impact on the measure calc time.
It can be something similar to:
=pick(ceil(log10(([MEASURE]))/3),
num(([MEASURE]),'$ #,##0.0'),
num(([MEASURE])/1000,'$ #,##0.0 K'),
num(([MEASURE])/1000000,'$ #,##0.0 M')
)
The above will give you dimension level format, but if you want to have one general format then you could even $() expand it...
To add to that.. If you do this in chart which has axis you may need to use something like below to retain proper scale:
=Dual(text(pick(ceil(log10(([MEASURE]))/3),
num(([MEASURE]),'$ #,##0.0'),
num(([MEASURE])/1000,'$ #,##0.0 K'),
num(([MEASURE])/1000000,'$ #,##0.0 M')
)),[MEASURE])
try with this
='$\ ' & [MEASURE]
This tells the Qlik engine to treat the appended character as a literal string value, preventing it from being interpreted as a variable expansion operator.