Retains a set of rows in your dataset, which are specified by the conditional in the |
The keep
transform is the opposite of the delete
transform. See Delete Transform.
keep row:(customerStatus == 'active') |
Output: For each row in the dataset, if the value of the customerStatus
column is active
, then the row is retained. Otherwise, the row is deleted from the dataset.
keep row:(expression) |
Token | Required? | Data Type | Description |
---|---|---|---|
keep | Y | transform | Name of the transform |
row | Y | string | Expression identifying the row or rows to keep. If expression evaluates to true for a row, the row is retained. |
For the keep
transform, if the expression for the row
parameter evaluates to true
for a row, it is kept in the dataset. Otherwise, it is removed.
Example:
keep row: (lastOrder >= 10000 && status == 'Active') |
Output: Retains all rows in the dataset where the lastOrder
value is greater than or equal to 10,000 and the customer status is Active
.
Required? | Data Type |
---|---|
Yes | Expression that evaluates to true or false |