Thursday, June 22, 2023

Explain the Number Function ' CEILING ' in Tableau with Example?

 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:

  1. Right-click on a blank area in the "Data" pane in Tableau.
  2. Select "Create Calculated Field."
  3. In the formula editor, enter the following expression:
CEILING([Sales])
  1. 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:

SalesRounded Sales
250.50251
620.75621
134.20135
900.00900

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

How can you create an alias for a table in a SQL query?

In SQL, you can create an alias for a table in a query to give the table a temporary, alternative name that you can use in the query. Table ...