Tableau Essentials: Calculated Fields – Introduction

Data

Tableau Essentials: Calculated Fields – Introduction

Not everyone is a Tableau guru, at least not yet. To help Tableau rookies, we’re starting from square one with the Tableau Essentials blog series. The series is intended to be an easy-to-read reference on the basics of using Tableau Software, particularly Tableau Desktop. Since there are so many cool features to cover in Tableau, the series will include several different posts.

Not everyone is a Tableau guru, at least not yet. To help Tableau rookies, we’re starting from square one with the Tableau Essentials blog series. The series is intended to be an easy-to-read reference on the basics of using Tableau Software, particularly Tableau Desktop 8.1 and 8.2. Since there are so many cool features to cover in Tableau, the series will include several different posts. This is the tenth post in the series. Check out the full list on our Tableau Essentials blog channel. This is also the first post in the Calculated Fields sub-series.

Today, we’ll scratch the surface on calculated fields in Tableau. There’s obviously a lot to cover in this particular section, and we’ll dig deeper into the various functions, formulas and capabilities with future articles, but today we’ll start simple and easy.

First, to open the Calculated Box dialogue window, you can right-click anywhere in the Data Window (also known as the Sidebar) to bring up the following contextual menu (OR under the Analysis menu at the top toolbar OR on the drop-down arrow next to the at the top right corner of the Dimensions box OR right-click on any field — many ways to achieve the same thing in Tableau):

Create Calculated Field

Select Create Calculated Field. Alternately, if you have an existing calculated field, you can right-click on that particular field and click Edit. However, when you get to the Calculated Box window, you’ll be presented with several different options:

Calculated Field box

The Name at the top of the box will be how the name of your new field will appear in the Data Window. Make the name something descriptive that will aid you in identifying it when it’s not so fresh in your mind. There are some great tips for controlling your metadata in Tableau here. The text box beneath is where you’ll build your calculation. Tableau offers several tools to help:

  • Fields: Here’s an alphabetical list of all the fields (both dimensions and measures) in your worksheet’s data source. You can use the drop-down menu at the top to help you filter the different fields you have by data type. Clicking once on any of the fields will bring up more information in the far-right text box (light yellow shading with rounded corners). Double-clicking on a field will insert it into your calculation work area running across the top of the screen. Fields are case-sensitive and require brackets [ ] around them when used in a formula.
  • Parameter: If you have any parameters that you have created, then you can also use them in your calculation. You do have the option to click on the Create button and make a new parameter on the fly. Parameters need brackets [ ] around them while used in a formula and, like fields, they are case-sensitive.
  • Functions: The drop-down list of functions shows you what’s possible to use in Tableau. When you select a function, the yellow-shaded text box next to the functions list is like a cheat sheet for different formulas to use in your calculated field. There are far too many for us to detail in this article, so we’ll address functions in future blogs. The drop-down menu will filter the different types of formulas based on type:

Functions

We’re going to focus on a simple calculation just to illustrate how the formula area works. Let’s create a simple subtraction formula by clicking on one measure, entering a subtraction sign and then clicking on another measure:Simple calculation

Tableau will automatically check to see if your calculation is valid. You can see Tableau’s green check mark at the bottom of the formula text area. Let’s purposefully enter a broken formula to see what happens. We’ll take the above formula and divide it by a text field:

Simple calculation

The red x indicates that we’ve got a problem with our formula. Tableau goes another step and offers a drop-down area at the end of the error message to help us troubleshoot our mistake:

Simple calculation 

Tableau picked up right away on our text field error. If you click on the error message, Tableau will take your cursor to the problem area of your formula for you to fix. When we’ve corrected the error, we’ll click OK and complete our calculation.

The new calculation will appear in the data window with a special icon to indicate that it is a calculation:  “=”

With all of the different formulas available in the Calculated Field window, it’s clear that there’s an incredible amount of power that Tableau offers in building custom formulas, calculations and advanced fields. The best way to develop mastery in Tableau once you’ve established the basics is to test and explore. And remember, if you make any mistakes, just use that handy Undo button in the toolbar.

Calculated Fields

Calculated fields can add a whole new layer of insight to your Tableau dashboards. The possibilities are practically endless, but we’ll be covering the fundamentals, especially functions, to help you build a foundational understanding of how and when to use them. Check back for more posts covering:

  1. Logical Functions
  2. Number Functions
  3. Date Functions
  4. String Functions
  5. Type Conversion
  6. Aggregate Functions
  7. User Functions

Another great resource for functions is Dan Murray’s best-selling guidebook, “Tableau Your Data!” It features a whole section devoted the functions we’ll be covering in this series and much, much more.

More Tableau Essentials

Want to learn more about Tableau? Here are the other Tableau Essentials posts we have so far:

More articles are coming soon, so check back regularly.

As always, let us know if you have any questions or comments about this post or Tableau in general. If you’re looking for personalized training or help with something bigger, contact us directly!

Want More Tableau Essentials

  1. Tableau Essentials: Chart Types – Introduction
  2. Tableau Essentials: Chart Types – The Text Table
  3. Tableau Essentials: Chart Types – Heat Map
  4. Tableau Essentials: Chart Types – Highlight Table
  5. Tableau Essentials: Chart Types – Symbol Map
  6. Tableau Essentials: Chart Types – Filled Map
  7. Tableau Essentials: Chart Types – Pie Chart
  8. Tableau Essentials: Chart Types – Horizontal Bar Chart
  9. Tableau Essentials: Chart Types – Stacked Bar Chart
  10. Tableau Essentials: Chart Types – Side-by-Side Bar Chart
  11. Tableau Essentials: Chart Types – Treemap
  12. Tableau Essentials: Chart Types – Circle View
  13. Tableau Essentials: Chart Types – Side-by-Side Circle View
  14. Tableau Essentials: Chart Types – Line Charts (Continuous & Discrete)
  15. Tableau Essentials: Chart Types – Dual-Line Chart (Non-Synchronized)
  16. Tableau Essentials: Chart Types – Area Charts (Continuous & Discrete)
  17. Tableau Essentials: Chart Types – Scatter Plot
  18. Tableau Essentials: Chart Types – Histogram
  19. Tableau Essentials: Chart Types – Box-and-Whisker Plot
  20. Tableau Essentials: Chart Types – Gantt Chart
  21. Tableau Essentials: Chart Types – Bullet Graph
  22. Tableau Essentials: Chart Types – Packed Bubbles
  23. Tableau Essentials: Formatting Tips – Introduction
  24. Tableau Essentials: Formatting Tips – Custom Shapes
  25. Tableau Essentials: Formatting Tips – Labels
  26. Tableau Essentials: Formatting Tips – Color
  27. Tableau Essentials: Formatting Tips – Tooltips
  28. Tableau Essentials: Formatting Tips – Maps
  29. Tableau Essentials: Calculated Fields – Introduction
  30. Tableau Essentials: Calculated Fields – Logical Functions
  31. Tableau Essentials: Calculated Fields – Number Functions
  32. Tableau Essentials: Calculated Fields – Date Functions
  33. Tableau Essentials: Calculated Fields – String Functions
  34. Tableau Essentials: Calculated Fields – Type Conversion
  35. Tableau Essentials: Calculated Fields – Aggregate Functions
  36. Tableau Essentials: Calculated Fields – User Functions

More About the Author

Carly Capitula

Principal / Enablement Practice Lead
A Quick Recap of the 2017 DRIVE/ Conference Last week, some of the InterWorks team dropped by Seattle, WA for DRIVE/ 2017 – a conference for professionals in fundraising and ...
Tableau Viz Showcase by Industry: K-12 Education “Data-driving decision making” is a phrase heard in several industries, perhaps none more so than in education. In such a scrutinized ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK