Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Transformation

  1. #1
    Join Date
    Aug 2010
    Posts
    4

    Default Transformation

    Hi,

    I'm new on Pentaho and I'm trying to rebuild our SAS transformations into PDI. I have the following situation:

    If var=1 then New_Var_1=var2;
    If var=2 then New_Var_2=var2;
    ...
    If var=100 then New_Var_100=var2;

    I try to use de Formula step, it's easy but in this case I need to write formula at least 100 times. Other way is use Javascript. I implemented the following code in javascript:

    for (i=0; i<=100; i++)
    {
    if (VAR == i)
    {
    this["NEW_VAR_" + i] = VAR2;

    }
    }

    But the problem is how to declare the new 100 variables in dynamic way. To include the new 100 variables in the result, I need to add var function and then use the option "Get variables". And in this case again, I need to write the same define 100 times.

    Any idea? Thanks,

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Do you know all values for "var"?

    You could use the denormalizer step to do what you are talking about..
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

  3. #3
    Join Date
    Aug 2010
    Posts
    4

    Default

    Yes, I know all values for "var". I tried to use denormalizer too, but in that case I need to define the name of all new variables and the key value... I have more than 100 new variables... I'm looking for something more dynamic or automatic...

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I'm working on it: http://www.youtube.com/watch?v=EjzgzOanq1o
    Covering the "Denormalizer" step is a good idea.

  5. #5
    Join Date
    Aug 2010
    Posts
    4

    Default

    Hi Matt,

    I'm really new on Pentaho, so I don't know if I understood correctly. I understand you are working on ETL Metadata injection...
    That means, there are not easy way (automatic or dynamic) to implement this kind of analysis process currently?

    Thanks,

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.