Selection: How do I make a Nper variable selection?
There may be some circumstances where records share an attribute and you only wish to select, perhaps, one record. For example, if a contact shares an email address you may want to select just one contact per that email address.
-
Right click on the summary line of the Selection window & select Apply 'N' per Variable from the pop up menu.
-
Check the box to activate the N Per Variable window and then drag and drop the required grouping variable onto the "Drop your grouping variable here" box.
The first row of the dialogue box has allowed us to determine that only one person per email address should be selected. It is also possible to use a further sequence variable to prioritise who of the multiple contacts should be selected. In this example, it is based upon the person in the highest income band (if more than one person is in the highest income band then a person will be randomly selected from that group). This is done by selecting the descending sequence on the Income variable.
-
Check the "sequence by" box, select "Descending" from the drop list and then drag and drop the Income variable onto the "Drop your sequence variable here" box.
The wording at the bottom of the dialogue box ensures it is clear what the values are in the sequencing variable. Therefore selecting Ascending will order the results from <£10k through to £100k+ and selecting Descending will order the results from £100k+ through to <£10k.
-
Click OK and build.
Notice that the selection now has a new icon next to it, indicating that N Per sampling is in effect. Non sequential variables can be ordered by the user when using Top N and N Per. See Selection: How do I make a Nper Selection? for further information.
The variables used must come from the same table level as the selection, or a higher table level.
Added in Q4 2023
You can also create N% per variable sampling in a selection.
See Selection: How do I make a N% per variable selection?