Amazon QuickSight – Aggregate Functions
In Amazon QuickSight, aggregate functions are used to perform calculations on groups of data. These functions take a set of values as input and return a single value as output.
Here are some of the aggregate functions that are available in QuickSight:
- sum: This function returns the sum of a set of values. For example, you could use the sum function to calculate the total sales for a particular region.
- count: This function returns the number of values in a set. For example, you could use the count function to calculate the number of orders in a particular time period.
- average: This function returns a set of values’ average (mean). For example, you could use the average function to calculate the average order value for a particular customer segment.
- min: This function returns the minimum value in a set of values. For example, you could use the min function to find the minimum order value for a particular product category.
- max: This function returns the maximum value in a set of values. For example, you could use the max function to find the maximum order value for a particular product category.
- median: This function returns the median value in a set of values. For example, you could use the median function to calculate the median order value for a particular customer segment.
When using aggregate functions in QuickSight, there are some rules that you need to follow:
- You can only use aggregate functions with numeric data. If you try to use an aggregate function with non-numeric data, QuickSight will return an error.
- When using aggregate functions in a visualization, you must specify how the data should be grouped. This is usually done by adding dimensions to the visualization.
- If you want to use aggregate functions in a filter, you need to use the Advanced filter option and create a filter expression that includes the function.
- When using aggregate functions in calculated fields or measures, you must specify which columns or fields the function should be applied to.
- When creating calculated fields or measures that use aggregate functions, you must be careful about the order in which the functions are applied. QuickSight applies filters before aggregations, so if you have a filter that excludes some of the data, the aggregation will be performed on the remaining data.
By following these rules, you can use aggregate functions in QuickSight to perform a wide range of calculations and visualizations based on your data.