Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: find a column name

  1. #1
    Join Date
    Oct 2007
    Posts
    4

    Default find a column name

    I need to find a particular column name based on a string created dynamically.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    getInputRowMeta() (in a javascript step e.g.) on the result of which you can find column names. But remember the output columns need to be fixed for all rows.

    Regards,
    Sven

  3. #3
    Join Date
    Oct 2007
    Posts
    4

    Default corresponding package

    what pentaho package is that function a partof. Well I am using version 2.5.1 getInputRowMeta() throws an error saying "function does not "
    Last edited by iswar; 12-06-2007 at 06:54 PM.

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Javascript step as in my original reply... have a look at http://wiki.pentaho.org/display/EAI/...2.5.x+to+3.0.0 for its use.

    Regards,
    Sven

  5. #5
    Join Date
    Oct 2007
    Posts
    4

    Thumbs up sample code just worked...

    well figured out what I really wanted

    var currMonth=date2str(get_end_date.getDate(),"MMM_yy");
    var end_date=date2str(get_end_date.getDate(),"yyyy-MM-dd");
    var value = Packages.be.ibridge.kettle.core.value.Value.getInstance();
    var idx=row.searchValueIndex(currMonth);
    value.setName("current_month");
    //value.setValue(Packages.be.ibridge.kettle.core.value.Value(currMonth));
    value.setValue(row.getValue(idx));
    row.addValue(value);

    Notice I had to use the index instead of something like
    value.setValue(Packages.be.ibridge.kettle.core.value.Value(currMonth));
    I don't know if my understanding of this interface is correct.
    Last edited by iswar; 12-06-2007 at 08:10 PM. Reason: some quick observations

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    Read over the 2.5 thing ... but do remember that when using it on 3.0 you will have to change.

    Regards,
    Sven

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.