Transformations
Sample
Takes a smaller, representative subset of the rows: a random percentage, a random fixed number, or simply the first or last rows.
When to use it
Use it to spot-check a large load, to build and test a flow quickly on a slice of a million-row file, or to pull an audit sample. For a strict top-N after sorting, Limit / Head-Tail reads more clearly.
In a pipeline
File InputSampleExport Excel
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| Sample by | select | — | percent |
| Percent of rows | number | — | 10 |
| Number of rows | number | — | 100 |
| Seed (same seed, same rows) | number | — | 1 |
Example
A 50% spot-check of orders
- Sample by=Random percent
- Percent of rows=50
- Seed (same seed, same rows)=1
| Order | Amount |
|---|---|
| A-1041 | 1240 |
| A-1042 | 860 |
| A-1043 | 312.5 |
| A-1044 | 95 |
| Order | Amount |
|---|---|
| A-1042 | 860 |
| A-1043 | 312.5 |
Which rows are drawn depends on the seed; the same seed and the same data always draw the same rows.
Worth knowing
- Random samples are repeatable: keep the Seed to get the same rows on every run, or change it (or use a variable) for a fresh draw.
- Sampled rows keep the order they arrived in; add Sort Rows afterwards for a different order.
- A percentage always keeps at least one row when there is any data, and 100% passes every row through.