# Sampling

## Apply sampling to cube cells

It is possible to apply the same sampling techniques used in a selection to the cells of a cube i.e. Limits, Top N records or N records per table. This means that when a selection is created by dragging cells off a cube, the selection will include the sampling options specified.

1. Create a cube of Income and Occupation at the **People** table.
2. Click on the **Sampling** button [![Sampling button](<https://help.apteco.com/assets/images/faststats/analysis/cubes/Cube-Q118-(34).png>)](<https://help.apteco.com/assets/images/faststats/analysis/cubes/Cube-Q118-(34).png>) to activate the function.
3. Highlight the cells that cover Occupation Director, Manager Professional with Income bands 30-40k, 40-50k, 50-60k.
4. Right click on one of the highlighted cells and select the option **Apply Sampling Limits…**

   [![Context menu on highlighted cells showing the Apply Sampling Limits option](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-HDI-use-Sampling-in-a-Cube-Q417-(1).png>)](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-HDI-use-Sampling-in-a-Cube-Q417-(1).png>) 5. Define the sampling to select a **Random 10%**.

   [![Sampling dialog with Random 10% selected](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-Q118-(35).png>)](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-Q118-(35).png>) 6. Left drag the highlighted cells onto the workspace to create a Limited selection to find a random 10% of the records in each cell.

   [![Workspace showing the Limited selection created by dragging the sampled cube cells](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-Q118-(36).png>)](<https://help.apteco.com/assets/images/faststats/analysis/cubes/sampling/Cube-Q118-(36).png>)

Use the **Top N** and **Nper** functions in the same manner as described above to have that sampling method applied to each cell selected.
