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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register 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