# Limit a selection

## Apply a limit

You can limit the records selected in a number of ways.

You may want to restrict a selection or part of a selection to a certain number of records. This is called applying a limit to a selection. In addition to this, FastStats lets you apply Top N limits on a selection or part of a selection so that you can define a rule to determine which records are selected. See [Top N selection](<https://help.apteco.com/en/faststats/analysis/selections/top-n-selection/index.md>) for more information on Top N selections.

Limits can be applied in the following three ways:

- **First** will take the first N records.
- **Regular Stratified** will take a sample using a regimented Nth.
- **Random** creates the sample using a random decision for each record.

To apply a limit on a selection:

1. Right click on the node in the selection tree which you want to apply the limit to.
2. Choose **Apply limits...** from the pop-up menu as shown below.
3. Choose the method for limiting the selection. The default setting will be **All** i.e. no restriction.

   - The **Skip First** text box is used to optionally skip the first N records.
   - The **Fraction** option lets you sample according to the fraction M / N.
   - The **Percentage** option lets you sample a percentage of records.
   - The **Fixed Total** option allows you to specify when to stop outputting records.
4. Click **OK** to apply the limits.

Notice that the node in the selection which now has a limit applied changes to display LMT as shown below. In this example, it is applied to the whole selection.

In the following example, a limit of the first 1000 records on the **Source of Telephone Enquiry** node has been applied. This selection will choose all records which have an Occupation of **Director** plus the first 1000 records which have a Source of **Telephone Enquiry**.

To modify a selection which has a limit on it, right click on the part which has the limit applied and choose **Modify Limits...** from the pop-up menu. To remove the limit, choose **All** on the resulting dialog box.

Related topics:

- [Nper variable selection](<https://help.apteco.com/en/faststats/analysis/selections/nper-variable-selection/index.md>)
- [N% per variable selection](<https://help.apteco.com/en/faststats/analysis/selections/n-percent-per-variable/index.md>)
- [Top N selection](<https://help.apteco.com/en/faststats/analysis/selections/top-n-selection/index.md>)
- [Aggregated Top N selection](<https://help.apteco.com/en/faststats/analysis/selections/aggregated-top-n-selection/index.md>)
