- The Data Point
- Posts
- Understanding Calculated Fields: Intermediate Tableau Training
Understanding Calculated Fields: Intermediate Tableau Training
The Key to Next Level Tableau-ing
Hey there đź‘‹
This weeks newsletter is brought to you by:
Kickstart your 2024 data career goals with Educative's exclusive holiday subscription deals! Boost your skills in some of the most sought after domains with over 1,000 courses and hands-on projects. Get 20% off today here.
Calculated fields are essentially the formulaic language of Tableau.
They allow you to create custom formulas and manipulate your data.
A bit intimidating at first if you’re new to them, but they use very similar syntax to most programming languages so they’re not too difficult to grasp.
Let’s explore how to create and utilize these fields, focusing on three essential examples to illustrate their versatility.
Open Your Workbook: Select the Tableau workbook you want to work with.
Access Data Source: In the data pane on the left, find your data source.
Create Calculated Field: Right-click in the data pane, choose 'Create', and then 'Calculated Field'.
Input Formula: A dialog box opens for entering your custom calculation.
Key Examples of Calculated Fields
1. Basic Arithmetic: Profit Margin
A common use of calculated fields is to compute ratios like profit margin.
Example:
(SUM([Profit]) / SUM([Sales])) * 100
This formula calculates the profit margin as a percentage. It sums up all the profit and sales values, divides profit by sales, and multiplies by 100 for a percentage. It’s a quick way to gauge overall profitability.
2. Conditional Logic: Sales Categorization
Conditional statements allow you to classify data based on set conditions.
Example:
IF [Sales] > 10000 THEN 'High'
ELSEIF [Sales] > 5000 THEN 'Medium'
ELSE 'Low'
END
This calculation segments sales into 'High', 'Medium', or 'Low' categories. It checks each sale amount: if more than 10,000, it's categorized as 'High'; between 5,000 and 10,000 as 'Medium'; and below 5,000 as 'Low'. This is useful for segmenting sales data for comparative analysis.
3. Date Functions: Days Since Last Activity
Date functions are crucial for time-series analysis.
Example:
DATEDIFF('day', [Last Activity Date], TODAY())
This calculates the number of days since the last recorded activity, comparing the 'Last Activity Date' field to the current date. It’s valuable for tracking customer engagement or product usage over time.
Why Use Calculated Fields?
Overall, calculated fields are a great way to customize your analysis and bring new fields into your data. They allow you to be more dynamic in your insights and explore data more in-depth than your original dataset may allow.
Some Final Notes
Know Your Data: Understand the data you are working with.
Practice: Keep experimenting. Get your reps in.
Annotation: Use comments for more complex calculations to remember your logic.
Next Step: Try creating some calculated fields in a project using the examples above as a guide. Hands-on practice is the best way to grasp new concepts.
If you need a dataset, go here: https://public.tableau.com/app/learn/sample-data
Other Stuff
I’m honored to be a Top Voice on Topmate!
I started hosting guidance calls on the platform back in March of this year.
Since then I've done 88 of them.
Topmate has been an incredible partner and I'm grateful to be one of their top users.
That’s it for this week.
See you next time
Matt ✌️
Whenever you’re ready, there are 3 ways I can help you:
1 | The Data Portfolio Guidebook
If you’re looking to create a data portfolio but aren’t sure where to start, I’d recommend this ebook: Learn how to think like an analyst, develop a portfolio and LinkedIn profile, and tackle the job hunt.
2 | 1:1 Coaching Call
For help navigating the data job hunt, consider booking a 1:1 career guidance session with me. There are a few options available to help you get to your ideal data job faster.
3 | Coaching Program
Interested in ongoing coaching? Fill out the form below for more information and to see if we’re a good fit.