3 RD
3 RD
Tableau Calculations, Overview of SUM, AVR, and Aggregate features, Creating custom
calculationsand fields
AIM:
Tableau Calculations, Overview of SUM, AVR, and Aggregate features, Creating custom
calculationsand fields
SOLUTION :
Tableau offers a powerful set of calculation tools that allow you to manipulate, transform,
and analyze your data in various ways. Here's an overview of some key concepts related to
Tableau calculations, including SUM, AVG (average), and aggregate functions, as well as
creating custom calculations and fields
SUM Function
The SUM function in Tableau calculates the total sum of a numeric field. You can use it to find the
sum of values in a column or as part of a more complex calculation. To use SUM, simply drag and
drop a numeric field into the "SUM" shelf, or you can create a calculated field using the SUM
function.
AVG (Average) Function
The AVG function calculates the average (mean) value of a numeric field. Like SUM, you can use it
by dragging a numeric field into the "AVG" shelf or creating a calculated field with the AVG
function.
Aggregate Functions:
Tableau provides a range of aggregate functions that allow you to perform calculations on groups of
data. Common aggregate functions include SUM, AVG, COUNT, MIN (minimum value), and MAX
(maximum value). These functions are particularly useful when you want to analyze data at different
levels of granularity (e.g., by category, region, or time period).
Creating Custom Calculations
Tableau allows you to create custom calculations using calculated fields. Here's how to create a
custom calculation:
In the Data Source Pane, right-click on your data source and select "Create Calculated Field".
Alternatively, you can create a calculated field by right-clicking on a shelf in your worksheet and
choosing "Create Calculated Field".
In the calculated field editor, you can use functions, operators, and field references to define your
calculation.
For example, you can create a calculated field to calculate profit margin as (SUM([Profit]) /
SUM([Sales])) * 100.
You can now use the calculated field like any other field in your worksheet. Drag it to the Rows or
Columns shelf, use it in filters, or create visualizations based on it.