# Max category

## Scenario

Identify the most expensive product someone has purchased

[![](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/max-category/Aggregations-on-the-fly-Q118-(1).png>)](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/max-category/Aggregations-on-the-fly-Q118-(1).png>)

- Click on the [![](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/Add-Aggregations-Button.png>)](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/Add-Aggregations-Button.png>) **Add Aggregation** button and then on the tab entitled **Frequency(Communications)** that opens up
- In the Type drop down select **Max Category**
- Set the Grouping Table to **People** and Transactional Table to **Bookings**
- Drag the **Destination** variable onto the **Group Transactions by** drop box
- Drag the **Cost** variable onto the **Drop your numeric variable here** box and leave the **Order by** as the default **Sum**

In this example we have grouped by destination and asked for the maximum cost in order to find an individual’s most expensive holiday destination.

A Data Grid can be used to validate the results:

[![](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/max-category/Aggregations-on-the-fly-Q118-(2).png>)](<https://help.apteco.com/assets/images/faststats/expressions/aggregations-on-the-fly/max-category/Aggregations-on-the-fly-Q118-(2).png>)
