In Tableau, the CEILING
function is a number function that rounds a given number up to the nearest integer or specified decimal place. It returns the smallest integer that is greater than or equal to the specified number.
The syntax for the CEILING
function in Tableau is as follows:
CEILING(number)
number
is the numeric value you want to round up.
Here's an example to illustrate the usage of the CEILING
function in Tableau:
Suppose you have a dataset with a column called "Sales" that contains various sales amounts.
Sales |
---|
250.50 |
620.75 |
134.20 |
900.00 |
To round up the "Sales" column to the nearest whole number using the CEILING
function, you can create a calculated field in Tableau:
- Right-click on a blank area in the "Data" pane in Tableau.
- Select "Create Calculated Field."
- In the formula editor, enter the following expression:
CEILING([Sales])
- Click "OK" to create the calculated field.
The calculated field, which utilizes the CEILING
function, will round up each value in the "Sales" column to the nearest whole number.
The resulting dataset will be as follows:
Sales | Rounded Sales |
---|---|
250.50 | 251 |
620.75 | 621 |
134.20 | 135 |
900.00 | 900 |
In this example, the CEILING
function rounds up each value in the "Sales" column to the nearest whole number. For instance, 250.50 is rounded up to 251, 620.75 is rounded up to 621, and so on.
The CEILING
function is particularly useful when you want to ensure that values are rounded up to the nearest whole number or a specific decimal place, such as rounding up prices, quantities, or measurements. By utilizing the CEILING
function in Tableau, you can perform these rounding operations and analyze data with the desired precision.
No comments:
Post a Comment
If you have any doubts. Please let me know