Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
peterderrington
Creator II
Creator II

Format expression in a label

Hi, 

Not sure if this can be done but i'm using the following expression as a label so that users can quickly see the numeric value in a graph but i want to limit the formatting to only 2 decimal places.

So the label expression is: =Concat('Mean Average Length of stay' & ' - ' & Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])))

Whilst the expression its displaying is Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year]))

and i get this image:

LOS.png

Now thats lovely but as i say i'd like to limit that output to just 2 decimal places so that it shows as 12.42

Can it be done?

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

try these

=Concat('Mean Average Length of stay' & ' - ' & Num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])),'0,00'))

=Concat('Mean Average Length of stay' & ' - ' & Num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])),'0.00'))

 

View solution in original post

4 Replies
zhadrakas
Specialist II
Specialist II

you can try to wrap num() like this

=num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])), '0,00')
peterderrington
Creator II
Creator II
Author

No, i'm missing something, when i try the whole expression in the label field :

=Concat('Mean Average Length of stay' & ' - ' & =Num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])),'0,0,0'))

I just get 'Error in expression'

Probably just missing a simple piece of syntax but i cant see it this morning

zhadrakas
Specialist II
Specialist II

try these

=Concat('Mean Average Length of stay' & ' - ' & Num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])),'0,00'))

=Concat('Mean Average Length of stay' & ' - ' & Num(Avg(TOTAL Aggr(Avg([Length of Stay - Days]),[Admission Month/Year])),'0.00'))

 

peterderrington
Creator II
Creator II
Author

It was the second one.

Thank you so much, very appreciated.