Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: How to do a loop in a transformation (ktr)

  1. #1

    Default How to do a loop in a transformation (ktr)

    Hi,

    I want to know how to make a loop process (repetitive process) in a ktr pentaho transformation.
    I don't find any predefined task (like sorting, import, validation..) to do this.

    Thanks in advance

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Transforms are designed to not allow loops.
    Tell us more about what you want to accomplish, and we can help you sort out how to do it.

  3. #3

    Default

    Thanks gulez

    I want to make some steps for the rows of each period(YYYYMM) in a file. I repeat the same steps (changing few things) for each period y want to make a loop from 201501 to 201506.
    Is it possile?, I prefer to do it in a ktr than in the job

    Thanks in advance

  4. #4
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    It depends on the steps.

    You might be able to process all the data in a single stream, but you might not be able to.
    If you are wanting to do exactly the same thing to all the dates, and *HAVE* to process them distinctly, then a Job is the right place to deal with it. What is your reason for not wanting to use a Job? Anything to do with flow control is intended to be dealt with at the Job level.

  5. #5

    Default

    Thanks gutlez,

    If it is not possible al job level I will do there. How do I do a loop al job level, using conditions?

    Thanks

  6. #6
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    You can build a loop in a job, and use the simple evaluation in order to do conditions.

    I haven't said that what you want to do can't be done in a transform... What I've said is you need to tell us more about your transformations before we can tell you how to do it.

  7. #7
    Join Date
    Sep 2014
    Posts
    175

    Default

    More details are needed, but if you want to loop a transformation, make the transformation, then have a job loop it.

    I don't think loops are possible at the transformation level (nor really necessary most of the time) -- due to the fact that the data flows through the stream all at once, instead of step by step, like a job. It would be more logically complicated.

  8. #8

    Default

    Thanks, it helps me.
    The reason to want the loop at transformation level is to use it in another jobs

  9. #9
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Quote Originally Posted by juanvg1972 View Post
    Thanks, it helps me.
    The reason to want the loop at transformation level is to use it in another jobs
    You can call jobs within other jobs.
    Depending on what you want to do, you might not need a job at all. Some steps (for example Group By) operate on a set of rows, rather than just one row.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.