Tableau Complex Calculations using Smaller Simple Calculations


A question often comes to mind of a Tableau developer when creating a large complex calculation, should I create one big complex calculated field? Or should I create several simple calculated fields to do the same thing? Both has their pros and cons, it can also vary based on the different business scenarios. But it is interesting to see which scenario is chosen based on the need by the developer.

Tableau Complex Calculations Management Best Practices
Tableau Complex Calculations Management Best Practices

Tableau Performance Considerations

From a performance perspective in Tableau, there will not be any noticeable performance effect if calculations were created more complex. Creating multiple simpler calculations helps maintain modularity and might be good in some cases. For example if we use ”month count” as a calculated field in multiple other calculations, actions, parameters, etc then it will help if we have this calculation as a separate field.

Tableau Scalability Factors

But we need to remember that it might become tricky when we have to make a change in our Tableau code, and it is nested in 5 different spots instead of one calculated field. Now, it will also be tricky when we have say for example 100 smaller simple calculated fields. We can organize these fields in folders for better readability and maintainability as well.

Tableau Flexible Naming Conventions

Some Tableau developers using naming conventions when dealing with several calculated fields. For example, if we are creating multiple calculations for one sheet or dashboard, we can prefix the fields with the letters ”MX [field_name]”. Or for say Boolean fields, we can add a prefix ”@[field_name]”. This kind of technique will allow us to easily find the calculated fields by filtering on the field names with a common pattern.

Tableau Optimal Readability

The balance of readability thus becomes the key. On top of it, one of the most important factors to consider is reusability. We should not be breaking one calculation when modifying another calculation. Adding good comments to the Tableau calculations is a good practice. This will allow others to know what one developer has done any why it was done that way.

Tableau Practice Test

The best Tableau practice exams built. Period. Explore definitive practical problems created by brilliant Tableau experts.

Published by Rahul

Comfortably confused :)

Leave a Reply