The Floor function rounds the input number up to the closest multiple of equal or lesser value.

Note that you may have unexpected rounding results when applying Floor to float data types; this behavior depends on how the underlying data warehouse calculates the function.

Syntax

Floor(number, factor)

The function has these arguments:

number
Required
The number or column of numbers to apply the function.
Note you may have unexpected results when using floating numbers, depending on the underlying database
factor
Optional
The multiple to apply to the Floor function. The direction of rounding is opposite that of the positive or negative sign of the factor. The factor cannot be 0.
Default is 1.

πŸ“˜

The Floor function may return unexpected results if the input column is coming from float data type.

Example

  • Returns 3.

Floor(3.6)

  • Returns -4.

Floor(-3.2)

  • (3) Returns the Floor for each row in the input column.

Floor(\[Cost\])

Screen_Shot_2020-11-30_at_3.53.11_PM.png
  • Returns the Floor at a factor of 0.5 for each row in the input column.

Floor(\[Cost\], 0.5)

Screen_Shot_2020-11-30_at_3.52.53_PM.png
  • Returns the Floor at a factor of -0.25 for each row in the input column.

Floor(\[Cost\], -0.25)

Screen_Shot_2020-11-30_at_3.52.40_PM.png
  • Returns the Floor at a factor of 2 for each row in the input column.

Floor(\[Cost\], 2)

Screen_Shot_2020-11-30_at_3.52.24_PM.png

Related resources