Picking rows backward and forward with the Analytic Query step

The Analytic Query step allows us to pick data from different rows in order to combine their values with the values in the current row. To demonstrate how to use this step, we will implement the first of the examples mentioned in the introduction. We have a list of sales by product line and date and want to see how sales evolve through months.

First of all, we will prepare the dataset:

  1. Create a new Transformation
  2. One more time, we will use our sample file with sales. So read the sample file with a Text file input step or copy and paste the step from another Transformation that reads it
  3. We have the date on which a product was sold. As we need the month, use a Select values step ...

Get Learning Pentaho Data Integration 8 CE - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.