transformations:filterminmax
Table of Contents
KEEP MIN/MAX
Category: Transform / Filters
Description
This action keeps (or removes) only rows with the biggest or smallest values in a specified column.
Use cases
Use this action to generate datasets of "top N" or "bottom N" (or "top %" or "bottom %") records based on values in a specific column.
Action settings
Setting | Description |
---|---|
Column | Select the column to filter values on. |
Keep or remove? | Select whether to keep or remove the highest/lowest values. Options: Keep or Remove. |
Biggest or smallest? | Select whether to keep/remove the largest values, or the smallest. Options: Biggest or Smallest. |
How many (numbers/dates)?* | Select whether to keep/remove a specific number of values (e.g. "3" for the top/bottom three values), or a percentage (e.g. "10" for the top/bottom 10% of values). Options: Count or Percent. |
Inside groups | When checked, the min/max process will operate within groups of values in the column(s) selected (and select the column(s)). |
* Setting can be specified using a parameter.
Remarks
Taking into account ties, the number of rows returned by this action may exceed the "Count" value entered. The "Count" value refers to the number of unique values, not the number of rows.
Examples
Example #1
Obtain the products with the lowest three prices.
Before (source table)
Product | Price, USD |
---|---|
Potato | 12.00 |
Carrot | 16.50 |
Orange | 14.95 |
Onion | 13.45 |
Cherry | 13.95 |
Garlic | 9.55 |
After (result table)
Product | Price, USD |
---|---|
Potato | 12.00 |
Onion | 13.45 |
Cherry | 13.95 |
Garlic | 9.55 |
Action parameters
Column: Price, USD
Keep or remove?: Keep
Biggest or smallest?: Smallest
Count: 3
Although the "Count" value was "3", four rows were returned due to the duplicate value "13" in two rows.
Community examples
- String manipulation (REVERSE) (Project; Module: Main; Group: Tab 1; Table: Using actions; Action position: 5)
- How to process parent-child data structures (Project; Module: Module 1; Group: Tab 1; Table: Longest folder path; Action position: 4)
See also
transformations/filterminmax.txt · Last modified: 2025/01/29 09:28 by yurii