Selection: How do I make an Aggregated Top N selection?
This feature allows you to take a numeric variable from a child table to use on the Top N function, without the need to create a virtual variable.
In this example, we will find the Top 10 People, based upon their total spend, using the Cost variable from the Bookings table.
-
Open a blank selection window at the People table level
-
Right click on the New Selection heading and select Apply Top N from the pop-up menu
-
Set the Top N window to show Top with a total of 10
- Drag the Cost variable onto the drop zone box
The Aggregated Value window gives you the opportunity to decide what action to perform on the numeric variable - e.g. Sum, Mean, Maximum etc. You can also apply a filter selection to determine which records are examined. In this example, leave the settings on their default.
-
Click OK on the Aggregated Value window
-
Click OK on the Top N window
-
Click the Build button to calculate the 10 records
The above Data Grid shows the 10 People with a Cell Aggregation column of their total spend.
Related topic: