Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

This examples illustrates how you can keep and delete rows from your dataset using the following transforms:

  • delete  - Deletes a set of rows as evaluated by the conditional expression in the row parameter. See See Delete Transform.
  • keep - Retains a set of rows as evaluated by the conditional expression in the the row parameter parameter. All other rows are deleted from the dataset. See Keep Transform.

Source:

Your dataset includes the following order information. You want to edit your dataset so that:

  • All orders for products that are no longer available are removed. These include the following product IDs:   P100,   P101,   P102,   P103.
  • All orders that were placed within the last 90 days are retained.

...

When this step is previewed, you should notice that the top row in the above table is highlighted for removal. Notice how the transform relies on the the ProdId value. If you look at the the ProductName value, you might notice that there is a misspelling in one of the affected rows, so that column is not a good one for comparison purposes. 

You can add the other product IDs to the transform in the following expansion of the transform, in which any row that has a matching ProdId value is removed:

...

D code

keep row:DATEDIF(OrderDate,today,day) <= 90

Don't forget to drop the the today column, which is no longer needed:

D code

drop col:today

Results:

OrderIdOrderDateProdIdProductNameProductColorQtyOrderValue
100712/28/2015P107T-shirtWhite7390
10081/15/2016P105CardiganRed8420
10091/31/2016P108CoatNavy9495