Working with scope and direction

In order to see how scope and direction work together, let's work through a few examples. We'll start by creating our own custom Table Calculations. Create a new calculated field named Index with the code Index().

Index() is a Table Calculation function that starts with the value of 1 and increments by one as it moves along a given direction and within a given scope. There are many practical uses for Index, but we'll use it here because it is easy to see how it is moving for a given scope and direction.

Create the table as shown previously with YEAR(Order Date) and QUARTER(Order Date) on Rows and Region and Department on Columns. Instead of placing Sales in the view, add the newly created Index field to the ...

Get Learning Tableau 2019 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.