### In Tableau, the SUM function is an aggregate function used to calculate the sum of a numeric field within a specified context or group. It allows you to find the total value of a field by adding up all the values.

The syntax for the SUM function in Tableau is as follows:

SUM(expression)

where the expression is the field or calculation for which you want to calculate the sum.

Here's an example to demonstrate how to use the SUM function in Tableau:

**Suppose you have a dataset that contains information about the sales of different products in a company. You want to calculate the total sales across all products.**

- Open Tableau and connect to your dataset.
- Drag the "Sales" field to the Columns shelf.
- In the Marks card, change the aggregation of the "Sales" field to "Sum" by clicking on the drop-down arrow next to the field and selecting "Sum."
- This applies the SUM function to the "Sales" field and calculates the total sales.
- Tableau will display the sum of the sales in the view.

The result will show you the total sales value across all products. This allows you to understand the overall revenue generated by the company.

**The SUM function can also be used with other aggregate functions or in combination with other calculations to perform more complex analyses. For example, you can calculate the percentage contribution of each product to the total sales by dividing the individual product sales by the sum of all sales.**

In summary, the SUM function in Tableau allows you to calculate the sum of a numeric field, providing insights into the total value or quantity in your dataset.

## No comments:

## Post a Comment

If you have any doubts. Please let me know