Tableau Numeric Calculations
In Tableau, numeric calculations are done using a wide range of inbuilt functions available in the formula editor.
Let's see how to apply calculations to the fields. The calculations are simple as subtracting the values of two fields or using an aggregate function to a single field.
Here are the steps to create a calculation field and use numeric functions in it.
How to Create a Calculated Field
Calculation Editor in Tableau
The above process opens a calculation editor which lists all the functions available in Tableau.
You can change the dropdown value and only see the related functions to numbers.
Create a Formula
o visualize the difference between Profit and Discount for different shipping mode of the products, create a formula that subtracts the Discount from the Profit, as shown in the below image, and the name of this field is profit_n_discount.
Using the Calculated Field
The above-calculated field can be used in the view by dragging it to the Rows shelf as shown in the below screenshot.
It produces a bar chart that shows the difference between profit and discount for different shipping modes.
Applying the Aggregate Calculations
You also can create a calculated field using an aggregate function.