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.
Basic Usage
Numeric literal example:
derive type:single value: CEILING(2.5)
Output: Generates a column with each row's value 3
.
Expression example:
derive type:single value: CEILING(MyValue + 2.5)
Output: Generates a column containing the smallest integer that is greater than the sum of 2.5 and the value in the MyValue
column.
Syntax and Arguments
derive type:single value: CEILING(numeric_value)
Argument | Required? | Data Type | Description |
---|---|---|---|
numeric_value | Y | string, decimal, or integer | Name 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 Type | Example Value |
---|---|---|
Yes | String (column reference) or Integer or Decimal literal | 2.5 |
Tip: For additional examples, see Common Tasks.
Examples
Example - Exponential functions
FLOOR
- largest integer that is not greater than the input value. See FLOOR Function.CEILING
- smallest integer that is not less than the input value. See CEILING Function.ROUND
- nearest integer to the input value. See ROUND Function.MOD
- remainder integer when input1 is divided by input2. See Numeric Operators.
Source:
rowNum | X |
---|---|
1 | -2.5 |
2 | -1.2 |
3 | 0 |
4 | 1 |
5 | 1.5 |
6 | 2.5 |
7 | 3.9 |
8 | 4 |
9 | 4.1 |
10 | 11 |
Transform:
derive type: single value: FLOOR (X) as: 'floorX'
derive type: single value: CEILING (X) as: 'ceilingX'
derive type: single value: ROUND (X) as: 'roundX'
derive type: single value: (X % 2) as: 'modX'
Results:
rowNum | X | modX | roundX | ceilingX | floorX |
---|---|---|---|---|---|
1 | -2.5 | -2 | -2 | -3 | |
2 | -1.2 | -1 | -1 | -2 | |
3 | 0 | 0 | 0 | 0 | 0 |
4 | 1 | 1 | 1 | 1 | 1 |
5 | 1.5 | 2 | 2 | 1 | |
6 | 2.5 | 3 | 3 | 2 | |
7 | 3.9 | 4 | 4 | 3 | |
8 | 4 | 0 | 4 | 4 | 4 |
9 | 4.1 | 4 | 5 | 4 | |
10 | 11 | 1 | 11 | 11 | 11 |
This page has no comments.