Skip to main content

Sample

Sample lets you see a small number of rows from a given dataset either in the original order or randomly. You can sample the entire dataset, a portion (such as a random sample or a percentage) of the dataset, or rows that meet a given condition. When sampling a dataset, the returned sample becomes the current dataset.

Format

Sample uses a single format: Sample the dataset <dataset> (randomly) (sorted by <sort column> in (ascending | descending) order) (where <column> is <predicate>) (then select <limit>) (with percentage <percentage>).

Parameters

Sample uses the following parameters:

  • dataset (required). The dataset to sample.
  • sort column (optional). The column to sort the sample by.
  • percentage (optional). Whether the sample should be drawn as a percentage of the dataset.
  • column (optional). The column whose values to use as part of the sampling criteria.
  • predicate (optional). The predicate used as part of the sampling criteria.
  • limit (optional). The desired sample size.

Output

If the dataset is successfully sampled, the sampled dataset becomes [dataset]_Sample.

Examples

To sample the dataset, enter Sample the dataset <dataset name>.

To sample the dataset randomly with a sample size of 50, enter Sample the dataset <dataset name> randomly then select 50.

To sample 15% of your dataset, enter Sample the dataset <dataset name> with percentage 15.

To sample only the rows in the dataset where the values of the Age column are greater than 18, enter Sample the dataset <dataset name> where Age is greater than 18.

To sample only the rows in the dataset where the values of the Age column are greater than 18 with a sample size of 20, enter Sample the dataset <dataset name> where Age is greater than 18 then select 20.

To sample only the rows where the "Gender" column is "Female" and sort the sample in ascending order based on the "Age" column (youngest to oldest), enter Sample the dataset <dataset name> where Gender is equal to the value Female sorted by Age in ascending order.