MAX_SUM
Calculates the largest sum of data field values for single or multi-loop data field value groups, all subject to data field filters if desired. Where the output can be changed to the second, third or so on highest AVERAGE. Where the output can also be changed to the corresponding loop field group value.

Function syntax
MAX_SUM(SUM input | Loop1, ... | filter1, ... | OUTPUT[field], RANK[n])Arguments:
- SUM input: The data field to sum.
- Loop1, …: The data field to split the data (e.g., by product, by region) for the averages. Multiple loop fields supported.
- filter1, …: (optional) The data field and value(s) used to limit the data. Can reference a cell (including DROPDOWN cells) for the field filter value.
- OUTPUT[field]: (optional) Select the loop field corresponding value as the output instead of the sum.
- RANK[n]: (optional) Return the Nth highest sum instead of the maximum (e.g., RANK[2] for second highest).
Examples
- MAX_SUM(sales | product) - Highest total sales by product.
- MAX_SUM(sales | product | channel{“Online”}) - Highest total sales by product, Online channel only.
- MAX_SUM(sales | product | | OUTPUT[product]) - Which product has the highest total sales.
- MAX_SUM(sales | product | | OUTPUT[product], RANK[2]) - Which product has the second highest total sales.
- MAX_SUM(sales | product, region) - Highest total sales by product and region combined.