Expressions: Aggregations on the fly - Value

Scenario 1:

Which destination has a person visited the most?

  1. Click on the Add Aggregation button.

  2. Click on the tab entitled FrequencyBookings and change the Type box to show Value.

  3. Set the Grouping Table to People and the Transactional Table to Bookings.

  4. Drag the Destination variable on as the value variable and leave the default Mode as the Function.

A Data Grid can be used to validiate the results:

Using a selector as the value variable results in a subset of relevant functions being presented. As well as the mode function, you can select from:

  • Count Distinct - used to establish e.g. how many distinct destinations a person visited

  • Maximum Distinct Count - used to establish e.g. how many times a person has been to their favourite destination

When using a numeric or currency value variable, a more extensive list of functions can be accessed.

Scenario 2:

What is the difference between each person's maximum and minimum cost of a booking?

  1. Click on the Add Aggregation button.

  2. Click on the tab entitled FrequencyBookings and change the Type box to show Value.

  3. Drag the Cost variable onto the Function drop box and change the function to display Maximum.

  4. Click on the Expression tab and enter a minus sign after the aggregation title.

  5. Click on the Add Aggregation button to generate a new aggregation tab.

  6. Click on the tab entitled FrequencyBookings and change the Type box to show Value.

  7. Drag the Cost variable onto the Function drop box and change the function to display Minimum.

  1. Click the Build button to see a preview of the results.

A Data Grid can be used to validate the results:

 

Click to return to Expressions: Aggregations on the Fly