Generate a number of row between start number and a end number

Four Stars

Generate a number of row between start number and a end number

Hi,

I have a row with an ID, a start number and end number, like:

ID      START     END

1           2             10

I need to convert this row in N rows,with the same ID for all lines and the column NUMBER must be between the column START and column END, in this case column NUMBER will be between 2 and 10. For example:

ID   NUMBER

1      2

1      3

1      4...

1      10

 

I tried it with a tjavarow but it don´t generate rows, only transform the input row.

Community Manager

Re: Generate a number of row between start number and a end number

Hi

 

You need to do a loop with tLoop based on the row data, the job looks like:

tFileInputDelimited--main-tflowToterate--iterate--tLoop--iterate--tFixedFlowInput--main--tLogRow

 

tFixedFlowInput: generate the current row.

 

Let me know if you need more help in detail.

 

Regards

Shong

 

 

----------------------------------------------------------
Talend | Data Agility for Modern Business
Nine Stars

Re: Generate a number of row between start number and a end number

you can try using tJavarow and Dynamic SQL join in tmap.

 

Loop Number.PNG

Regards,

 

Veeru Boppudi
Four Stars

Re: Generate a number of row between start number and a end number

Hi,

 

Finally, I did it with trowgenerator and tmap. I crossed my data with the trowgenerator. Trowgenerator generate the numbers between 1 and 1000. 

If I do an iterate i think it was be very slow. 

 

Thanks for all your help.

 

andorra.PNG

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download