Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I need help with round function.
round(0.2461412134614245,.0001) and round(0.2753054367009194,.0001)
How can i get the output for the above number as follows - 24.6% and 27.6% ?
Thanks
text box
=round(0.2461412134614245,.001) * 100 & '%'
Thnaks,
=round(0.2753054367009194,.001) * 100 & '%' = 27.5%
but i need 27.6%
Thanks
1
=num(ceil(num(num(.2461412134614245)*100),0.01),'#.##0,0')
2
=ceil(num(num(0.2753054367009194)*100),0000.1)
If its just for display purposes, then keep it simple and use Num():
Num(0.2461412134614245, '%0.0')
If its for other (non-display) purposes where need the rounded values (eg a dimension), then the % sign may be unnecessary and use:
Round(0.2461412134614245, 1/1000) // if its used internally or in script
or
Num(Round(0.2461412134614245, 1/1000), '%0.0') // for a dimension
Some of the guys above have already hit on things, but I am going to through out a Design Blog post for you as well, that might help things make a bit more sense. The only way I see to get what you want is to change your offset value from .0001 to .001, that should do the trick as well, but as things are, they are working as expected from what I can see. Using the step option could work, but I am betting you do not want to go up or down a whole integer either. Thanks to the other guys above comments as well, they are all good, just hoping this one may fill in the gaps a bit for you.
https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808
Regards,
Brett