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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
2 Replies
swuehl
Champion III
Champion III

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