Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
MVP
MVP

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

erichshiino
Partner - Master
Partner - Master

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