Another approach to Order of Operations

Vignesh Suresh
2 min readFeb 26, 2023

Assume We have a Table as shown below

I drag State to the Filter and choose Alabama. We see New York is ranked 1. After Alabama is selected, we see Alabama is re-ranked as shown below.

We will see re-ranking for all States after filtering. This is because of the Order of Operations. When we choose Alabama, The Dimension filter State is chopping off the whole table and only keeps Alabama and is doing the re-ranking with Rank, which is a Table Calculation. The original ranking is not maintained.

If I want to maintain the original Rank, then we need to change and bend the Order of Operations.

Working explanation:

The State is a dimension filter, which chops the table to the filtered value, and does the re-ranking with Rank, which is the Table Calculation. We need to change the Order of Operations in such a way that the Dimension filter is computed before the Table Calculation, and gets computed after the Table Calculation.

We can make the Dimension filter, a Table Calc filter so that it is executed after Table Calc so that re-ranking is not done and original rankings are maintained. We use LOOKUP() with the State and create a calculation as shown

Drag this to the filter and choose Alabama. The original rank will be maintained and no re-ranking will be done as shown below.

I hope you found this helpful. Thanks for reading.

Vignesh Suresh

Twitter

LinkedIn

Tableau Public

--

--