Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hai guys,
how to use round() function??
plese give me script??
example u have data like
sales:
100.23
200.34
300.55
then
to round the sales
round(sales) >round(100.23)> output is 100
round(300.55) > 301
floor(), ceil() [and not to forget round()] all have the same possible arguments:
ceil(x [ , base [ , offset ]])
Rounding of x upwards to the nearest multiple of base with an offset of offset. The result is a number.
floor(x [ , base [ , offset ]])
Rounding of x downwards to the nearest multiple of base with an offset of offset. The result is a number.
round( x [ , base [ , offset ]])
Rounding of x upwards or downwards to the nearest multiple of base with an offset of offset. The result is a number. If x is exactly in the middle of an interval, it is rounded upwards.
'x' is your input number. 'offset' is the number your intervals start from. base is the interval increment.
So ex2.floor( 1.1 , 1 , 0.5 ) creates intervals like [0.5, 1.5]; [1.5, 2.5]; [2.5, 3.5] ...
If your input is 1.1, the first interval is the matching one. floor() now returns the lower limit and ceil() the upper limit of the matching interval.
Hope this helps,
round(2.4) - 2
round(2.6) -3
round(3.88,0.1) - 3.9
round(3.88,5) - 5
round(1.1,1,0.5) - 1.5
use as expression as the example
if(round(sales) > 3, round(3.88), round(3.88,0.1))
Hi Vishnupriya,
Please follow below links:
Re: Doubts in understanding the ceil and floor functions
http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors
Regards
Nitha
Hi vishnupriya ,
pls close this thread by marking correct and helpful answer