Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Qlik Nice Number Format
//---------------------------------------------- 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
You can’t perform that action at this time.