Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help on Ceil function

Can someone please explain the parameters base and offset in the Ceil function with an example. Please do not copy paste the explanation from the help manual as I did not understand from that?

1. ceil( 3.88 , 0.1 ) returns 3.9

2. ceil( 3.88 , 5 ) returns 5

3. ceil( 1.1 , 1 , 0.5 ) returns 1.5

How qlikview produces the result in above three scenarios?

Thanks in advance for your help.

3 Replies
oknotsen
Master III
Master III

In 1) you are asking ceil to round up to the nearest multiple of 0.1, which is 3.9

0.0, 0.1, 0.2, 0.3, 0.4, etc

In 2) you are asking ceil to round up to the nearest multiple of 5, which is 5

0, 5, 10, 15, 20, etc

Edit:

I had read your function wrong for option 3 (so removed that part of my reply). I am correctly corrected by the reply underneath this one.

May you live in interesting times!
swuehl
MVP
MVP

Ceil() rounds x up to the nearest multiple of step [+ offset]

Hence in case 3), it's rounded up to the nearest value of 0.5, 1.5, 2.5, 3.5 ...

For the value of 1.1, the result is thus 1.5.

Same for any value >0.5 and <=1.5

Anonymous
Not applicable
Author

I undrestand now.Thanks all for your reply