/    /  Amazon QuickSight – maxOver

Amazon QuickSight – maxOver

 

Amazon QuickSight’s maxOver() function is used to compute the maximum value of a measure within a specified partition. It operates on a measure and allows you to calculate the maximum value for a given dimension or a group of dimensions.

 

Syntax

#Start#
maxOver
(
     measure 
     ,[ partition_field, ... ] 
     ,calculation level 
)
#End#

 

This function takes the following arguments:

 

  • measure: This is the measure for which you want to calculate the maximum value. It can be any numeric field in the dataset.
  • partition_field: This is an optional parameter that allows you to specify one or more dimensions that partition the data.
  • calculation_level: This is an optional parameter that specifies the level of detail for the calculation. You can choose from detail, pane, or total.

 

 

Suppose you have a dataset of sales transactions with columns for product, region, and sales amount. You want to find the maximum sales amount for each product category, regardless of the region.

 

You can use the maxOver() function as follows:

Example

#Start#
maxOver(Sales, [Product], Detail)
#End#

 

This will return the maximum sales amount for each product category, with the calculation performed at the detail level. If you wanted to see the maximum sales amount for each product category within each region, you could modify the function as follows:

 

Example

#Start#
maxOver(Sales, [Product, Region], Detail)
#End#

 

This will return the maximum sales amount for each product category within each region, with the calculation performed at the detail level.