Sample tool icon

Sample Tool

Last modified: September 09, 2021

Docs are available before the release of Designer Cloud so you can get a sneak peek. This content might change between now and the official release.

One Tool Example

Sample has a One Tool Example. Visit Sample Workflows to learn how to access this and many other examples directly in Alteryx Designer Cloud.

Use Sample to limit the data stream to a specified number, percentage, or random set of rows. In addition, the Sample tool applies the selected configuration to the columns you want to group by. 

Configure the Tool

  1. Select a sampling method. The options are...
    • 1st N Rows: Returns every row in the data from the 1st through row N.
    • Last N Rows: Starting from the row that is N rows away from the end of the data, returns every row through to the end of the data.
    • Skip 1st N Rows: Returns all rows in the data starting after row N.
    • 1 of Every N Rows Will Be Sampled: Returns the 1st row of every group of N rows.
    • 1 in N Chance to Include Each Row: Randomly determines if each row is included in the sample, independent of the inclusion of any other rows.

      The option 1 in N Chance to Include Each Row returns an approximation. For example, if you have 1,000 rows, select a random sample, and specify N as 10, you might expect the tool to return 100 rows. However, it could return between 75 and 150 rows.

    • 1st N% of rows: Returns N percent of rows. This option requires the data to pass through the tool twice: once to calculate the count of rows and again to return the specified percent of rows. 
  2. Enter a number in N= to specify the value for N.
  3. Columns to Group By: If groups are specified, N rows are returned for each group.

    If you select to group by a column named City, specify N as 2, and select First N Rows, Designer Cloud returns the first 2 rows for each City.

Was This Page Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support. Can't submit this form? Email us.