Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: In Job--how to direct to next transformation step based on a value from previous step

  1. #1
    Join Date
    May 2007
    Posts
    9

    Default In Job--how to direct to next transformation step based on a value from previous step

    Hello,

    I'll really appreciate if someone can give me some help with the following case.

    In a job, I have few transformations. And in one transformation, there's a query SELECT COUNT(*).... I need to decide which transformation step to go next based on the value returned from this COUNT. Is there a way to do it in Kettle?

    Thanks so much!
    Grace

  2. #2

    Default

    Hi grace,
    First, send the result of your query to "Copy rows to result" step..
    Your trans should something like :

    "Table output" --> "Copy rows to result"

    Then, in your job "evaluate" the result thanks to Java script job entry (evaluation).

    count= rows[0].getInteger("count", 0);
    count >0 (for example)

    If the count >0 then the evaluation should return true and the followed job entry (with green hop) should be executed otherwise the reb hop one.

    Rgds

    Samatar

  3. #3

    Post

    I attached sample job...
    it will show you how it works.
    Last edited by shassan2; 01-25-2008 at 01:53 PM.

  4. #4
    Join Date
    May 2007
    Posts
    9

    Default

    Thanks a lot for the help! It's very helpful!

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.