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.
There are different ways to create calculated fields in Tableau, as follows:
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:
18.224.44.53