Expressions: Aggregations on the Fly - Value
Scenario 1:
Which destination has a person visited the most?
-
Click on the Add Aggregation button
-
Click on the tab entitled FrequencyBookings and change the Type box to show Value
-
Set the Grouping Table to People and the Transactional Table to Bookings
-
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?
-
Click on the Add Aggregation button
-
Click on the tab entitled FrequencyBookings and change the Type box to show Value
-
Drag the Cost variable onto the Function drop box and change the function to display Maximum
-
Click on the Expression tab and enter a minus sign after the aggregation title
-
Click on the Add Aggregation button to generate a new aggregation tab
-
Click on the tab entitled FrequencyBookings and change the Type box to show Value
-
Drag the Cost variable onto the Function drop box and change the function to display Minimum
-
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