An Introduction to Calculated Fields in Tableau
Calculated fields create new data field from the data that already exists in your data source. When you create a calculated field, you are essentially creating a new area or new dimensions (or column) or measures in your data source, the values which are determined by a calculation that is controlled by the user. This new calculated field is saved to your data source in Tableau and can be used to create more robust visualizations. Your original data remains untouched. They can be used with various data types or with a multitude of functions and aggregations, as well as with logical operators, making the calculated results virtually limitless.
Why to use Calculated Fields?
In Tableau calculated fields are used for many reasons. Some examples might include:
- To segment data in a proper way
- To convert the data type of a field into another, such as converting a string to a date or vice-versa.
- To aggregate the result of the data
- To take advantage of the power of parameters
- To filter the results for better analysis
- To calculate ratios across various variables in Tableau
Types of calculations
There are basically three main types of calculations that are used to create calculated fields in Tableau:
- Basic calculations– Basic calculation allows you to change the values or members at the visualization level of detail (an aggregate calculation) or the data source level of detail (a row-level calculation).
- Level of Detail (LOD) expressions- Unlike basic calculations, LOD calculations enables you to compute the values at the data source and the visualization level. However, LOD calculations give you even more control on the granularity level. It gives you the choice that whether you want it to be performed at a more granular level (INCLUDE), a less granular level (EXCLUDE), or an entirely independent level (FIXED) with respect to the granularity of the visualization.
- Table calculations- Table calculations allow you to change the data at the level of detail of the visualization only.