Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Can I use a Job parameter in a transformation formula?

  1. #1
    Join Date
    Sep 2015
    Posts
    15

    Default Can I use a Job parameter in a transformation formula?

    I have a transformation that was using a constant as both a file output value and as a reference inside a formula.
    The constant was named MMPRIORMDT, of type String, and had the value "01/01/2015"
    It was used in this formula: TEXT(MONTH(DATEVALUE([MMPRIORMDT]));"#"), to set a new field, [MON], to a string value between 1 and 12
    I now want to have a parameter in a job set this value for each run, e.g. "02/01/2015"
    I'm not sure what I have to change to make this work. When I replace [MMPRIORMDT] in the formula with ${MMPRIORMDT}, I get a parse exception.
    Is my syntax incorrect, or is it not possible to use a parameter value inside a formula?

  2. #2
    Join Date
    Nov 2009
    Posts
    688

    Default

    I don't think you canuse variable/parameters in a formula. When you want to use formula you need tofill a column with the parameter. You can do that with a JavaScript. Of causeyou can do everything in the JavaScript. See example
    Attached Files Attached Files

  3. #3
    Join Date
    Sep 2015
    Posts
    15

    Default

    Thank you.

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.