Wednesday, June 28, 2023

Explain the Table Calculation Function 'RUNNING_MAX' in Tableau with Example?

 The RUNNING_MAX function in Tableau is a table calculation function that calculates the running maximum value of a field or expression over a specified scope or order. It provides the maximum value observed up to the current data point within the defined scope.

The syntax for the RUNNING_MAX function in Tableau is as follows:

RUNNING_MAX([expression])

  • [expression]: The field or calculation for which you want to calculate the running maximum.

Here's an example to demonstrate how to use the RUNNING_MAX function in Tableau:

Suppose you have a dataset that contains daily temperature data for different cities. You want to calculate the running maximum temperature for each city over time.

  1. Open Tableau and connect to your dataset.
  2. Create a view that includes the "City" field, the "Date" field, and the "Temperature" field.
  3. Right-click on the "Temperature" field in the view and select "Add Table Calculation."
  4. In the Calculation Type drop-down, select "Running Max."
  5. In the "Compute Using" section, choose the appropriate dimensions to define the partitioning and addressing for the calculation (e.g., "City" and "Date").
  6. Click "OK" to apply the table calculation.

Tableau will calculate the running maximum temperature for each city over time. It identifies the maximum observed temperature starting from the first data point and continues tracking the maximum value with each subsequent data point within the defined scope.

You can further customize the view, apply sorting, or add additional calculations based on the running maximum. For example, you can create a visualization that shows the trend of the maximum temperature for each city or identify periods with the highest temperatures.

The RUNNING_MAX function allows you to calculate the running maximum of a field or expression within a specified scope. It helps you identify the highest value observed up to the current data point and track the maximum value over time or within a particular grouping.

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