Thursday, June 22, 2023

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

The division operator ("/") is a mathematical operator in Tableau that performs division between two numbers. It divides the value on the left-hand side of the operator by the value on the right-hand side.

Here's an example to illustrate the usage of the division operator in Tableau:

Suppose you have a dataset with columns "Revenue" and "Quantity" representing sales revenue and the quantity sold.

RevenueQuantity
150010
25005
180012
30008

To calculate the average revenue per quantity using the division operator in Tableau, you can create a calculated field:

  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:

[Revenue] / [Quantity]
  1. Click "OK" to create the calculated field.

The calculated field, which utilizes the division operator ("/"), will calculate the average revenue per quantity for each row in the dataset.

The resulting dataset will be as follows:

RevenueQuantityAverage Revenue per Quantity
150010150.0
25005500.0
180012150.0
30008375.0

In this example, the division operator ("/") is used to calculate the average revenue per quantity by dividing the revenue value by the quantity value for each row.

The division operator in Tableau, along with other mathematical operators, allows you to perform calculations involving division, such as calculating averages, ratios, or proportions. 

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 ...