Scope and direction

Scope and direction are terms that describe how a Table Calculation is computed relative to the table. When a Table Calculation is relative to the layout of the table, rearranging the fields in the view will not change the scope and direction:

You've already seen Table Calculations being calculated table (across) (the running sum of sales over time) and table (down) (in the previous table). In these cases, the scope was the entire table and the direction was either across or down. For example, the running total calculation ran across the entire table, adding subsequent values as it moved from left to right.

To define scope and direction for a Table Calculation, use the drop-down menu for the field in the view and select Compute Using. You will get a list of options that will vary slightly depending on the location of dimensions in the view. The first of the options listed allows you to define the scope and direction relative to the table. After the option for cell, you will see a list of dimensions present in the view. We'll take a look at those in the next section.

Options for scope and direction relative to the table:
  • Scope options: Table, pane, and cells
  • Direction optionsDown, across, down then across, across then down

In order to understand these options, consider the following example:

When it comes to the scope of Table Calculations, Tableau makes the following distinctions:

The bounded areas in the preceding screenshot are defined by the scope. Scope (and as we'll see, also partition) defines windows within the data that contain various Table Calculations. Window functions, such as WINDOW_SUM() in particular, work within the scope of a window.