Troubleshoot your calculations by creating a Tableau troubleshooting view! Read the first post in this series to get an overview of the method.

 

Some features of Tableau require special steps to visualize what's happening.

 

Level of Detail calculations

 

Add the dimensions and expression from calculation to the view

  1. Edit the calculation to find all of the dimensions listed in our FIXED/INCLUDE/EXCLUDE expressions
  2. For FIXED/INCLUDE add the dimensions to the Rows shelf
  3. For EXCLUDE remove the dimensions from the view
  4. Highlight the entire expression after : and drag the highlighted section into the view

 

Why: FIXED expressions are calculated at the level of detail that’s specified in the dimension declaration. INCLUDE functions are calculated as if the listed dimensions were included in the view. EXCLUDE expressions are computed at if those dimensions were removed from the view.

 

Seeing the results at the level of detail of the calculation makes it easier to see what’s going on.

 

 

For FIXED expressions, add filters to context

  1. Right-click the field on the Filters shelf
  2. Select Add to Context

 

Why: Context filters are evaluated before FIXED calculations, which means context filters will filter FIXED expressions.

 

 

Table Calculations

 

Verify Compute using setting is correct

  1. Right-click the table calculation
  2. Select Edit Table Calculation and modify the Compute using settings as needed

 

Table calculations have a lot of flexibility in how they can be computed in order to provide different results. To learn more, see Transform Values with Table Calculations

 

 

Verify that the Compute using setting is the same

  1. Navigate to a place where the table function is returning the expected results
  2. Right-click the table calculation
  3. Select Edit Table Calculation and make note of the selected settings
  4. Navigate back to the table calculation returning unexpected results
  5. Right-click the table calculation
  6. Select Edit Table Calculation
  7. Update the settings to match step 3

 

Why: There are some scenarios where we will need to compare table calculations. Such as when we take a piece of a table calculation out of the calculation we are troubleshooting, or if the same table calculation is being used on multiple views. If we want the table calculations to return the same result, then we will need the table calculation to be computed the same way.

 

Remember that Compute Using settings on a field will apply to all table functions in that field. If two table functions should be computed differently, then one function should be moved to another calculation. See Nested Table Calculations

 

 

Drag quick table calculations into calculation editor to see formula

  1. Select Analysis > Create Calculated Field
  2. Drag the field in the view with the quick table calculation applied into the calculation editor

 

Why: Tableau writes out the formula used for the quick table calculation in the calculation editor.

 

Data blending

 

There are several scenarios already published on our product help page. See Troubleshoot Data Blending.

 

Add the linking field(s) to the view

  1. Navigate to the secondary data source
  2. Add all fields with an orange active link icon to the Rows shelf
  3. Navigate to the primary data source
  4. Add all equivalent linking fields to the Rows shelf
  5. Do all of the values in linked fields match?

 

Why: A common issue with data blending is that the link between the data sources is not working as expected. This could be because there are mismatching values in the linking field in each data source. This could be due to the date level the link is on. This could be because the secondary data source has a higher level of granularity than the primary data source.

 

 

Create separate worksheets without blending

  1. Create a new worksheet
  2. Drag the field(s) from one data source into the view
  3. Create another new worksheet
  4. Drag the field(s) from the other data source into the view
  5. Compare the two worksheets

 

The fields dragged into the view could be the linking fields, the dimensions used in the original view, and/or the measures used in the original view.

 

Why: When isolating a piece of a calculation that comes from a secondary data source, the reason the piece may be returning the wrong values may have to do with how the blend is set up. Before troubleshooting the blend, we can create a new worksheet that does not use any data blending. If the new worksheet is showing the same values for the piece in question, we can rule out data blending as the cause of the issue.

 

 

Activate or deactivate links

  1. Navigate to the secondary data source
  2. Click broken link gray icons to activate them
  3. Click orange link icons to deactivate them

 

Why: Sometimes the issue is simply that the linking field isn’t active on that worksheet or that too many linking fields are active. When activating multiple linking fields, only rows that have all matching values (from all active linking fields) will be brought in from the secondary data source.

 

Tableau Desktop will automatically add the option to link fields that have the same name in both data sources. More relationships can be defined manually. See Establishing a link relationship

 

 

Totals

 

Remove all dimensions from the Rows or Columns shelf

  1. For Automatic Column totals remove all fields from the Rows shelf

 

Why: Automatic column totals return the same value as if all dimensions were removed from the opposite shelf.

 

 

Change the Total Using aggregation

  1. Right-click the measure in the view
  2. Select Total using > {aggregation}

 

Why: By default Tableau uses Automatic totals, which use the aggregation of the calculation. See Grand totals and aggregations

 

Apply Table Calculation Filter to totals

  1. Right-click the table calculation on the Filters shelf
  2. Check Apply to Totals

 

Why: By default, table calculation filters are not applied to totals.