M.E.
M.E.

Reputation: 5505

How to duplicate rows using another data grid in Pentaho 8 CE

I have a data grid with the following fields and one row:

Data Grid
Fields: A   , B   , C
Row 1:  fooA, fooB, 

I have another data grid with the following rows -just one field-:

Intervals
Fields: C
Row 1:  10
Row 2:  20
Row 3:  35
Row 4:  40

I would like to understand which Pentaho Data Integration (Kettle) step/box shall be used to get:

Fields: A   , B   , C
Row 1:  fooA, fooB, 10
Row 2:  fooA, fooB, 20
Row 3:  fooA, fooB, 35
Row 4:  fooA, fooB, 40

Merge two data grids

Upvotes: 0

Views: 950

Answers (1)

Cristian Curti
Cristian Curti

Reputation: 1054

That is a simple Join Rows (Cartesian product), though i do not know how exactly are you going to use this for variable data, if the Grid with 1 row multiple columns will ALWAYS have 1 row and multiple columns than it is fine, a cartesian product will replicate fooA, fooB in N' rows from the second grid.

All you have to do first in the second grid is split the single field into 2 columns, one with the "Row X" and another with the number value.

Your KTR should look something like this:

enter image description here

Which outputs this:

enter image description here

Upvotes: 2

Related Questions