Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
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
Highlighted
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')
Highlighted
Creator II
Creator II

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

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

Highlighted
Creator II
Creator II

It was the second one.

Thank you so much, very appreciated.