Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Extracting name/value pairs from table field

  1. #1
    Join Date
    Aug 2007
    Posts
    8

    Default Extracting name/value pairs from table field

    Hi,
    I have a MS SQL database table with a field that contains name=value pairs (multiple entries within the one field). I would like, during the transformation, the store them in their own separate fields within my table.

    Is this possible and how could I do that?

    Thanks

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

    Default

    Split fields step, and if that doesn't work for you you can probably do it in Javascript.

    Regards,
    Sven

  3. #3
    Join Date
    Aug 2007
    Posts
    8

    Default Extracting name/value pairs from table field

    Thanks. The split function seems to only let me break out by say a comma ,

    I have, inside the field, however

    name=val1,nam2=val2,name3=val3

    and I want new columns with the field name of 'name, nam2,nam3' and their corresponding values.

    I'm not too familiar with javascript. Any ideas how it might be done if not with split?

    Thanks

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

    Default

    In the FAQ there's an example of making a new column in javascript, and also an example on splitting things.

    If you do add new columns remember that every row needs to have the same columns (same name, order, type), and the some parts of it will have be "rewritten" (at least touched) for v3.

    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.