Appendix A. Calculated Fields Primer

Often when we analyze or visualize data, we find ourselves needing additional fields, which are not available in the data source. Not to worry! Most of the time, we can derive these fields using some logic within the Tableau scripting language. We can choose to create ad hoc calculations and even save them back in our Tableau data source or workbook so we can reuse them for multiple worksheets.

Different ways to create calculated fields

There are different ways to create calculated fields in Tableau, as follows:

  1. From the drop-down arrow beside the Dimensions section in the side bar:
    Different ways to create calculated fields
  2. From the field you want to use in the calculated field:
    Different ways to create calculated fields
  3. From the Analysis menu:
    Different ways to create calculated fields
  4. From the Rows or Columns shelf by double-clicking on an empty space. This is called ad hoc calculation:
    Different ways to create calculated fields
  5. From the Marks card by double-clicking on an empty space. This is also called an ad hoc calculated field:
    Different ways to create calculated fields

If you create an adhoc calculation, this piece of information can only be used within the worksheet you created it in. This is not viewable in other worksheets in the same workbook. If you need to persist this field, you can simply drag the pill that contains the ad hoc calculation to anywhere in the side bar. You can rename this field once you see it in the side bar. Once the field is saved, you can use this anywhere in the workbook, just like any other calculated fields. This is shown in the following screenshot:

Different ways to create calculated fields
..................Content has been hidden....................

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