Creating a Calculated Field

To create a new Calculated Field, go through the following steps:

  1. Click on the small arrow next to Dimensions in the Data pane, highlighted in the following screenshot: 

It's also possible to right-click on a field and go to Create to start a new Calculated Field based on this field. You can edit a Calculated Field when you right-click on it.

  1. When you create a new Calculated Field, a new window opens where you have to write a formula. The formula can be based on other fields, calculated or not, and use functions.
  2. On the right, when you click on the arrow, you can open the list of functions.
  3. When you write a formula, at the bottom of the window, Tableau indicates to you whether the calculation is valid or not. You can also see the dependencies (other Calculated Fields and Sheets that use this Calculated Field). 
  4. Click on OK when you are done and the calculation is valid.

Here's an example of the calculation window with a list of functions open:

When you write a formula, the fields are in orange and between brackets, and the functions are in blue.

There is auto-completion, meaning that when you start writing at least one character, Tableau opens a list of suggestions based on all the fields and functions available. You just have to press Enter or click on the desired element. Here's an example of auto-completion:

You can also drag and drop any field in the calculation window to add it to the formula.

When using fields in a formula, you can decide whether to aggregate them or not; let's discover what the difference is. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.137.76