Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Setting up a "Scripting" formula in a Kettle transformation

  1. #1
    Join Date
    Sep 2013
    Posts
    1

    Default Setting up a "Scripting" formula in a Kettle transformation

    I have a "Scripting" formula (node) connected to my incoming records. I want to flag (with a value of 1) the records that have a given field with values that are out of range and to output the result in a new column, which I named in the formula node. So, in the formula node I have...

    IF (AND ([given_field] >= 300; [given_field] <= 880); 0; 1)

    When I execute a "Preview" in the formula node, I get the following error message:

    2013/09/03 13:52:20 - Transformation TEST 2 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Errors detected!

    The node that supplies the data to this formula node runs successfully. How does the above formula in blue need to be changed to run successfully?

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Is given_field <null>/NA at any time in the run? If so, you have to wrap it into a IFNA or ISNA function.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Tags for this Thread

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.