##### Page tree

Trifacta SaaS

Contents:

Computes the largest integer that is not more than the input value. Input can be an Integer, a Decimal, a column reference, or an expression.

Wrangle vs. SQL: This function is part of Wrangle , a proprietary data transformation language. Wrangle is not SQL. For more information, see Wrangle Language.

## Basic Usage

Numeric literal example:

floor(2.5)

Output: Returns the value 2.

Expression example:

floor(MyValue + 2.5)

Output: Returns the largest integer that is less than the sum of 2.5 and the value in the MyValue column.

## Syntax and Arguments

floor(numeric_value)

ArgumentRequired?Data TypeDescription
numeric_valueYstring, decimal, or integerName of column or Decimal or Integer literal to apply to the function

For more information on syntax standards, see Language Documentation Syntax Notes.

### numeric_value

Name of the column, numeric literal, or numeric expression.

• Missing input values generate missing results.
• Literal numeric values should not be quoted. Quoted values are treated as strings.
• Multiple columns and wildcards are not supported.

Usage Notes:

Required?Data TypeExample Value
YesString (column reference) or Integer or Decimal literal2.5

## Examples

Tip: For additional examples, see Common Tasks.

### Example - Exponential functions

This example demonstrates how the rounding functions work together.

Functions:

ItemDescription
FLOOR Function Computes the largest integer that is not more than the input value. Input can be an Integer, a Decimal, a column reference, or an expression.
CEILING Function Computes the ceiling of a value, which is the smallest integer that is greater than the input value. Input can be an Integer, a Decimal, a column reference, or an expression.
ROUND Function Rounds input value to the nearest integer. Input can be an Integer, a Decimal, a column reference, or an expression. Optional second argument can be used to specify the number of digits to which to round.
MOD Function Returns the modulo value, which is the remainder of dividing the first argument by the second argument. Equivalent to the % operator.

Source:

rowNumX
1-2.5
2-1.2
30
41
51.5
62.5
73.9
84
94.1
1011

Transformation:

Transformation Name New formula Single row formula FLOOR(X) 'floorX'

Transformation Name New formula Single row formula CEILING(X) 'ceilingX'

Transformation Name New formula Single row formula ROUND (X) 'roundX'

Transformation Name New formula Single row formula (X % 2) 'modX'

Results:

rowNumXmodXroundXceilingXfloorX
1-2.5 -2-2-3
2-1.2 -1-1-2
300000
411111
51.5 221
62.5 332
73.9 443
840444
94.1 454
10111111111

See Also for EXAMPLE - Rounding Functions:

• Page:
• Page:
• Page:
• Page:

• Page:
• Page:
• Page:
• Page:
• Page:
• Page:
• Page:
• Page:
• Page:
• Page: