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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ceil and floor functions

Hello community,


What is the application of ceil and floor function?

Have any of you used it in a real time scenario?

Kindly reply as none of my questions have ever been answered on the community.

Regards,

Vishal

1 Solution

Accepted Solutions
jvitantonio
Specialist III
Specialist III

Hello Vishal,

Ceil function will round up a number. Ex: ceil(3.4) will return 4.

Floor will round down a number. Ex: floor(3.4) will return 3.

I use this when working with timestamps with hour and minutes values. Behind each date there's a number associated. Those dates with time, will have a decimal value (56321,23) where 23 represents the time and minutes (this is a random example!).

When in your model you don't need to use the hour, you can use ceil(Date) so your dates will always be DD/MM/YYYY 00:00:00 instead of DD/MM/YYYY 10:36:00.

This can also be used to format values. If you are working with big amounts, it might not tell you much to show the decimal. Instead of showing $26.354.201,31, you can use the ceil or floor function and round up/down the number, or using the format in the Number tab for the charts.

I hope this helps.

J

View solution in original post

3 Replies
jvitantonio
Specialist III
Specialist III

Hello Vishal,

Ceil function will round up a number. Ex: ceil(3.4) will return 4.

Floor will round down a number. Ex: floor(3.4) will return 3.

I use this when working with timestamps with hour and minutes values. Behind each date there's a number associated. Those dates with time, will have a decimal value (56321,23) where 23 represents the time and minutes (this is a random example!).

When in your model you don't need to use the hour, you can use ceil(Date) so your dates will always be DD/MM/YYYY 00:00:00 instead of DD/MM/YYYY 10:36:00.

This can also be used to format values. If you are working with big amounts, it might not tell you much to show the decimal. Instead of showing $26.354.201,31, you can use the ceil or floor function and round up/down the number, or using the format in the Number tab for the charts.

I hope this helps.

J

Not applicable
Author

Thank you

Anonymous
Not applicable
Author

I had to use ceil in an expression that calculates the amount of days worked based on the number of hours worked. Even if the employees worked half or a quarter of their norm, I had to consider the day as worked.