Tableau: Order of Execution


Order of Execution in Tableau:

Computed in the database:
1. Context filters
2. Top N and conditional filters
3. Regular quick filters

Computed in Tableau:
4. Table calculations are computed
5. Table calculation filters are applied
6. Reference lines

This means that for a Top N chart that needs to display the Top 10 Sales per State, Average Sales of Top 10 States and the Average Total Sales all States, you have to make sure that the average all states needs to be computed before the filter is applied, you have to use the Window_AVG and add it to dual axis as line. The Top N condition needs to be applied after the Window_Avg calculation. The Windows_AVG is calculated in step 4, so the TOP N needs to be in step 5 or 6. The ‘Normal’ way of calculating TOP N is on database and cannot be used that leaves a table calculation filter. Add the Sales measure to the filter, add a quick table calculation Rank, and then modify this to run along State and keep the sorting in Descending order.

In case you need a filled area chart on Percent of Sales with possible filter option, this execution path means you need to make sure you create a table calculation on your filter dimension else the % of Total will be 100% instead of the correct share of total. You could use e.g. a calculated field like Region select: lookup(Max([Region]),0) and then filter on this new field.

Recent Related Posts
Femke Kooij is a dashboard and report designer, developer and educator specializing in SAP | BusinessObjects Dashboards (better known as Xcelsius) and Crystal Reports. She has also a lot of experience with other SAP | BusinessObjects toolings like, Web Intelligence (WebI), Information Design Tool (Universe Designer), BusinessObjects Data Services (BODS) and the overall server platform BusinessObjects Enterprise (Launchpad, CMC). She spends a lot of her time thinking about and sharing her knowledge of Xcelsius to others through her own blog. Lately she is exploring other visualization tools like Qlikview and Tableau. On the later she is also posting some experiences. Currently she is in the employment of Cognizant Technology Solutions. Her blog only contains her personal views, thoughts and opinions. It is not endorsed by Cognizant Technology Solutions nor does it constitute any official communication of Cognizant Technology Solutions.

This entry was posted in Tableau and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>