PDA

View Full Version : Is there a Looping Technique?



kettle_anonymous
04-18-2006, 09:33 PM
Attachment: Sample year month generator.ktr (http://forums.pentaho.org/archived_att/kettle/Sample year month generator.ktr) I have a very huge table with historical data. I want to transfer all of the data into another table. The data should be retrieved by month for 6 years. As of now, I am doing this manually and this means that I am having this. The data should be retrieved monthly because there are some computations happening and I cannot just specify 1/1/2000 to 12/31/2006.

Select * from tables where month(d1)=X and year(d1)=Y

Where X is month and Y is year.

1 2000 (January 2000)
2 2000 (February 2000)
.
.
12 2006 ( December 2006)

I am looking at the Add Sequence step and I cant figure out how to make this fit. Anyone interested to help me? Thank you very much! I am thinking that this should be placed in a loop and supply the Query with parameters. But how can I make the steps loop?

- Cholo -

jbleuel
04-19-2006, 12:50 AM
Attachment: Sample year month generator.ktr (http://forums.pentaho.org/archived_att/kettle/Sample year month generator.ktr) Hi Cholo,

I attached a transformation which does this generation from 01/2000 until 12/2009. Do a preview at the dummy step to see the result. This can be used further ;-)

Cheers,
Jens