Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

whats wrong with this expression??!!

I have the following expression

=if(MonthName = 'Dec 2012',num(Avg([Satisfaction Score]),'##')-88,num(Avg([Satisfaction Score]),'##')-89) & '%'

but am getting the result as 9.5 which should be rounded to 10

2 Replies
swuehl
Not applicable

Re: whats wrong with this expression??!!

I would suggest using a format code like '0' instead of '##'. Or use round() function.

erich_shiino
Not applicable

Re: whats wrong with this expression??!!

Instead of formating when if is true and when it is false, you can just round the if:

=round(if(MonthName = 'Dec 2012',(Avg([Satisfaction Score])')-88,(Avg([Satisfaction Score]))-89)) & '%'

I guess it failed because you used num, but you included another oepration (- 88 or -89) and the format was lost

Hope it helps,

Erich