Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Which transformation to use

  1. #1

    Default Which transformation to use

    I am reading data from csv file and loading into the table. Target table has one derived column which is derived from column coming from the source. This derived column need to be populated that data such that if length of a column coming from source more than 4chars then populate column A else Column B.

    Data is like this in file
    Colum A , Colum B , Key

    What I need in table is like this
    Colum A , Colum B , Key, Derived column

    Can not fin any function in calculator/string operation etc which can be used to calculate the length of a string column. Also if else clause will be required for the same .

    Any pointers will be greatly appreciated. Can explore further if someone can help with the name of transformations which needs to be used.

    Hemant Jain

  2. #2


    You could do this with a Javascript step.
    Pentaho BI Solutions for ERP

  3. #3
    Join Date
    Nov 2008


    Use the Formula step. It has a LEN function and an IF construct.

    You could also use either the Modified Java Script Value step or the User Defined Java Expression step but both will require a little knowledge of the Java language.
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  4. #4
    Join Date
    Apr 2008


    In PDI 4.3:
    Calculator step: Return the Length of String A.


  5. #5


    Thanks . Was able to do the same using calculator and Forumla.

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.