on 08-28-2014 12:53 PM
Dear All,
I have to split the quantity from a Source Table to a Result Table as describe below :
SOURCE TABLE
ID--------------CITY------------QTY
1----------------New York---------5
2----------------LONDON----------2
3----------------SIDNEY------------3
And I have to achieve the target below reported :
RESULT TABLE
ID--------------CITY------------QTY
1----------------New York---------1
2----------------New York---------1
3----------------New York---------1
4----------------New York---------1
5----------------New York---------1
6----------------LONDON---------1
7----------------LONDON---------1
8----------------SIDNEY-----------1
9----------------SIDNEY-----------1
10---------------SIDNEY----------1
How I can do this using Data Integrator ?
Best Regards,
MJ
Hello
This is very easy assuming the QTY column has a small number of options.
Create a new table table (or use row generation transform) to prepare a dataset with 1 column - QTY. In this dataset add the number of rows equal to QTY value. Then join this new dataset to your original dataset on the QTY column.
For example
QTY
1
2
2
3
3
3
The are other solutions if QTY has a large number of possible values.
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Michael,
I found the very similar solution here : Create Multiple rows based on column value
Thank you and Best Regards,
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.