Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Feature Request

  1. #1
    Join Date
    Sep 2005
    Posts
    1,403

    Default Feature Request

    Add Constants feature can become very powerful if constants can be added to input conditionally (based on logic). Right now only static constants that are allowed.

  2. #2
    Join Date
    Nov 1999
    Posts
    459

    Default RE: Feature Request

    Could you give us more info or an example for a better understanding ;-)
    Thanks,
    Jens

  3. #3
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Feature Request

    Lets say I have an excel file with 2 sets of data spanning 20 rows. Rows 1 through 10 belong to a type value 1 and rows 11-20 belong to a type value 2. Lets say the type value is a column in my source data set. I want to add a constant field on the value in the 'type value' column.


    if <type value column> == 1
    constant = X
    if <type value column> == 2
    constant = Y



    Hope this makes sense.

  4. #4
    Join Date
    Nov 1999
    Posts
    459

    Default RE: Feature Request

    Why do you need the "non static constant"? Could you give us information about the hole transformation process? May be we could solve the problem another way...

    Thanks a lot,
    Jens

  5. #5
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Feature Request

    I want to transfom this data

    col1col2col3col4

    A1BC

    D1EF

    G1HI

    J2KL

    M2NO




    into this



    col1col2col3col4col5

    A1BC1

    D1EF2

    G1HI3

    J2KL1

    M2NO2



    where column 5 is a constant value based on column 1

    thanks

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

    Default RE: Feature Request

    Hi,

    Just write a small piece of javascript that compares col2 current record with the previous one.
    Then just add a number allongside. Should be about 10 lines of code like this:

    var prevCol2;
    var col5 = 1;
    if (prevCol2 != null )
    {
    }

    prevCol2 = prevCol;
    ...

    Cheers,

    Matt

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.