Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: How to do...

  1. #1
    Join Date
    Mar 2009
    Posts
    137

    Default How to do...

    ... this?

    I have one input A with three fields:
    - column : String
    - is-value : String
    - new-value : String

    And I have another input B from a database:
    type : integer
    name : string
    height : integer
    width : integer
    comment : string

    Now I have to change the values of the columns saved in A (field column) to new-value if the current value is is-value in B... any ideas?
    e.g. in A is a row with:
    - column = "height"
    - is-value = "100"
    - new-value = "150"
    that means that every height-field in B with a value of 100 have to be changed to 150...

    I had a solution using a repository and the "Mapping-Step" but this solution does not work with files (kjb, ktr) cause it uses named parameters with the "Mapping-Step"... any ideas?

    Thanks!
    Last edited by Jogilein; 06-23-2009 at 10:56 AM.

  2. #2

    Default

    You can use a javascript step.
    You can read the filed with field.getString() (if value if a string)
    and change the value with fieldName.setValue().
    Example, adding 10 to height value:

    valueAux = height.getNumber() + 10

    height.setValue (valueAux)

  3. #3
    Join Date
    Mar 2009
    Posts
    137

    Default

    I love the JavaScript Step ... but I'm not sure how this should work with this step... Cause I have two different inputs... one with the values (and columns) to change and one with the data... how can I access both in JavaScript?

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.