0
0
Tableaubi_tool~5 mins

Creating calculated fields in Tableau - Complete Walkthrough

Choose your learning style9 modes available
Introduction
Calculated fields let you create new data from your existing data by using formulas. This helps you analyze data in ways not directly available in your original dataset.
When you want to add a new column that shows profit margin as a percentage.
When you need to combine first and last names into a full name field.
When you want to categorize sales into 'High', 'Medium', or 'Low' based on amount.
When you want to calculate the difference between two dates.
When you want to create a flag to highlight customers with purchases over a certain amount.
Steps
Step 1: Click
- Data pane on the left side
A menu appears with options related to your data fields
Step 2: Select
- Create Calculated Field option from the menu
A dialog box opens for you to enter your formula
Step 3: Type
- Calculation editor in the dialog box
You see your formula text and can edit it
Step 4: Name
- Name field at the top of the dialog box
Your calculated field will appear with this name in the Data pane
Step 5: Click
- OK button in the dialog box
The new calculated field appears in the Data pane and can be used in your views
Before vs After
Before
Data pane shows original fields like Sales, Quantity, and Profit
After
Data pane shows original fields plus a new calculated field named 'Profit Margin %'
Settings Reference
Calculation Editor
📍 Create Calculated Field dialog box
To write and edit the formula for the calculated field
Default: Empty formula area
Name Field
📍 Top of the Create Calculated Field dialog box
To give a meaningful name to the new calculated field
Default: Calculated Field
Validate Button
📍 Bottom of the Create Calculated Field dialog box
To ensure the formula syntax is correct before saving
Default: Enabled
Common Mistakes
Typing a formula with syntax errors
Tableau will not accept the formula and shows an error message
Use the Validate button to check the formula and fix errors before clicking OK
Using field names incorrectly (e.g., missing brackets)
Tableau requires field names to be enclosed in square brackets to recognize them
Always put field names inside square brackets like [Sales]
Naming the calculated field with a name that already exists
Tableau will overwrite the existing field or cause confusion
Give a unique and descriptive name to each calculated field
Summary
Calculated fields create new data from existing data using formulas.
You create them by selecting Create Calculated Field and typing a formula.
Always validate your formula and use correct field name syntax.