Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: What is equivalent to Informatica's Expression transformation in Kettle?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question What is equivalent to Informatica's Expression transformation in Kettle?

    Hi,

    I am new to kettle and evaluating it for one of prospect.

    can anybody help me in finding transformation step in kettle equivalent to Informatica's Expression transformation(or abinitio's reformat)?

    or
    how can I do the following:

    source data:
    -----------
    empno,empname,emp_salary
    1,abc,7000
    2,xyz,13000
    3,xcv,22000

    Target data:
    -----------
    empno,empname,emp_salary_grade
    1,abc,C
    2,xyz,B
    3,xcv,A

    logic for transformation is
    if salary >=0 and <10000 then grade is C
    if salary >=10000 and <20000 then grade is B
    if salary >=20000 then grade is A

    Please help me on this.

    Thanks
    Suneel

  2. #2
    Join Date
    Feb 2009
    Posts
    296

    Default

    There is a "Number Range" step in PDI 3.2.0.
    You can do it with JavaScript in older versions.
    You may even do it with a couple of filter and "set constant" steps.
    Fabian,
    doing ETL with his hands bound on his back

  3. #3

    Default

    Suneel for your question in specific the equivalent to Expression would be a Java script transformation , thats what i have noticed till now ...

    But for ur example as replied by fabian , you can do that using the steps described.

  4. #4

    Default

    Thanks Fabian & Casper.

    First of all can u please let me know that do I need to learn java script to work on PDI as I don't have experience of Java.

    Moreover, The example I illustrated above is very straight forward.It might be possible that these categorisations are stored in some file (say rule file) such as:

    min_sal max_sal salary_grade
    0 2000 A
    2001 4000 B
    4001 8000 C
    8001 12000 D
    and so on.

    i.e. if salary >=min_sal and salary<=max_sal then value of salary_grade column would be treated as GRADE.

    Now, in this case, I am not sure how many filters would get used and how the filter conditions will be applied.

    Please help me understanding this situation.

    Thanks a lot.
    Suneel

  5. #5
    Join Date
    Sep 2007
    Posts
    834

    Default

    If you have the info in a file, you can get the proper "emp_salary_grade" by using a "Stream Lookup" Step.

  6. #6
    Join Date
    Sep 2007
    Posts
    834

    Default

    Sorry, I made a mistake. The stream lookup doesn't have comparators as "database lookup" do.
    One possible way to do the task is to merge the two streams (the main and the stream with the config.file) and then filter the records that meet the condition min<=salary<=max.

  7. #7

    Default

    Hi Maria, I am not able to understand your solution. Could you please explain it in detail? what do you mean by config.file?

Tags for this Thread

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.