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: 
woshua5550
Creator III
Creator III

Floor Function

Hi there

I'm really confused about Floor() function

why Floor(3.51,-0.5) returns 4.0 ?

why Floor(3.51,-0.9) returns 3.6 ?

how it works ,plz explain in calculation detail  , thx

1 Solution

Accepted Solutions
Sergey_Shuklin
Specialist
Specialist

Hello, Dave!

Draw a little picture for you:

floor_ins.png

the negative value of the base in Floor() function returns the nearest right value

View solution in original post

6 Replies
Sergey_Shuklin
Specialist
Specialist

Hello, Dave!

Draw a little picture for you:

floor_ins.png

the negative value of the base in Floor() function returns the nearest right value

woshua5550
Creator III
Creator III
Author

Amazing !

Can I come to this conclusion ?

Floor(a,-b) = Ceil(a,b)

Ceil(a,-b) = Floor(a,b) ?

Sergey_Shuklin
Specialist
Specialist

Yes, (at least I tried different examples) and it seems to be that your conclusion is correct 😃

Magic of rounding =D

woshua5550
Creator III
Creator III
Author

Brilliant ! thanks a lot Sergey

ThienThanh
Contributor
Contributor

Thank you so much!