Qlik Nice Number Format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------- Nice Numberformat simplified --------------------------------------------- | |
// does work with count in KPI object (have seen several versions from Qlik which haven't worked) | |
Set vF_NiceNumberSimple = | |
If(Fabs($1) > 1e9, Num($1/1e9+1e-13, '#$(ThousandSep)##0$(DecimalSep)00') | |
,If(Fabs($1) > 1e8, Num($1/1e6+1e-13, '##0$(DecimalSep)0') | |
,If(Fabs($1) > 1e6, Num($1/1e6+1e-13, '##0$(DecimalSep)00') | |
,If(Fabs($1) > 1e5, Num($1/1e3+1e-13,'##0$(DecimalSep)0') | |
,If(Fabs($1) > 1e3, Num($1/1e3+1e-13, '##0$(DecimalSep)00') | |
, $1, | |
))))) & | |
If(Fabs($1) > 1e9, ' Mrd' | |
,If(Fabs($1) > 1e8, ' Mio' | |
,If(Fabs($1) > 1e6, ' Mio' | |
,If(Fabs($1) > 1e5, ' tsd' | |
,If(Fabs($1) > 1e3, ' tsd' | |
, '' | |
))))) | |
; | |
//---------------------------------------------- Nice Numberformat simplified --------------------------------------------- | |
// usage: | |
$(vF_NiceNumberSimple(Count(distinct Expression1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ralfbecher Ralf, I've been doing something similar and I was wondering, why are you concatenating the num format to the text (Mrd, Mio, ...)?$1/1e9+1e-13, '#$ (ThousandSep)##0$(DecimalSep)00 Mrd') work just the same and be shorter?
Wouldn't something like this If(Fabs($1) > 1e9, Num(