Meritshot Tutorials

  1. Home
  2. »
  3. Common Table Calculations (e.g., Running Total, Percent of Total)

Tableau Tutorial

Common Table Calculations (e.g., Running Total, Percent of Total)

Running Total

Definition and Purpose: A running total accumulates values incrementally over a specified period. This calculation is useful for understanding cumulative progress, tracking trends, or identifying patterns over time.

Steps to Create a Running Total:

  1. Drag Measure to View: Start by placing a measure (e.g., sales) on the Rows or Columns shelf.
  2. Apply Running Total Calculation:
    • Right-click the measure, select “Quick Table Calculation,” and choose “Running Total.”
  3. Configure Computation:
    • Choose the appropriate “Compute Using” option, such as “Table (Down)” for time-series data, to ensure correct aggregation.

Example: To track cumulative sales for each month of the year, apply a running total calculation to monthly sales data. This will show how total sales accumulate over the months.

FAQs:

Q1: How do I reset the running total calculation periodically (e.g., quarterly)?

A1: Use partitioning and addressing options to reset the running total based on a specific dimension (e.g., quarter).

Q2: Can running totals be used with non-time dimensions?

A2: Yes, running totals can be applied to any dimension where cumulative aggregation is relevant.

Percent of Total

Definition and Purpose: The percent of total calculation shows the proportion of each data point relative to the total sum. It helps in understanding the relative contribution of individual components.

Steps to Create Percent of Total:

  1. Drag Measure to View: Place a measure on the Rows or Columns shelf.
  2. Apply Percent of Total Calculation:
    • Right-click the measure, select “Quick Table Calculation,” and choose “Percent of Total.”
  3. Configure Computation:
    • Adjust the “Compute Using” settings to determine how the percentage should be calculated (e.g., across categories).

Example: To show each product category’s percentage contribution to total sales, apply the percent of total calculation to sales data grouped by category.

FAQs:

Q1: How can I display percent of total for specific segments of data?

A1: Use filters and partitions to focus on specific segments and apply the percent of total calculation accordingly.

Q2: Can percent of total be used with multiple dimensions?

A2: Yes, you can calculate the percent of total within subcategories or dimensions to show detailed contributions.

Moving Average

Definition and Purpose: A moving average smooths out fluctuations by averaging values over a specified number of periods. It is used to identify trends and patterns by reducing noise in the data.

Steps to Create a Moving Average:

  1. Drag Measure to View: Place a measure on the Rows or Columns shelf.
  2. Apply Moving Average Calculation:
    • Right-click the measure, select “Quick Table Calculation,” and choose “Moving Average.”
  3. Configure Window Size:
    • Specify the number of periods for the moving average calculation (e.g., 3 months).

Example: To analyze sales trends over a year, apply a moving average calculation to smooth out monthly sales data and identify long-term patterns.

FAQs:

Q1: How do I choose the appropriate window size for a moving average?

A1: The window size should align with the frequency and granularity of your data, such as monthly or quarterly periods.

Q2: Can moving averages be customized for different time intervals?

A2: Yes, you can adjust the moving average calculation for various time intervals, such as days, weeks, or months.

Rank

Definition and Purpose: The rank calculation assigns a rank to each data point based on its value within a partition. It is useful for comparing items or categories relative to each other.

Steps to Create a Rank Calculation:

  1. Drag Measure to View: Place a measure on the Rows or Columns shelf.
  2. Apply Rank Calculation:
    • Right-click the measure, select “Quick Table Calculation,” and choose “Rank.”
  3. Configure Ranking Method:
    • Choose the ranking method (e.g., ascending or descending) and specify how the ranking should be applied (e.g., within categories).

Example: To rank sales representatives by total sales performance, apply a rank calculation to the sales data.

Frequently Asked Questions

Q1: How do I handle ties in ranking calculations?

A1: Configure the ranking method to handle ties, such as assigning the same rank to tied values or using average rank.

Q2: Can rank calculations be applied to dimensions other than numerical measures?

A2: Rank calculations are typically applied to measures but can be influenced by dimensions for comparative analysis.