Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: NULL in Formula Step

  1. #1

    Default NULL in Formula Step

    Hi,
    I want to create a new column which is calculated from existing columns. I tried something like this.

    Designation and Salary are existing columns.
    If([Designation]="PAT";[Salary];0)

    This did work. But i want to get a null in the place of zero. Please help.

  2. #2
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    use NA() to get a null.

  3. #3

    Default

    I tried like this.

    If([Designation]="PAT";[Salary];NA())

    But it dint work

    org.pentaho.reporting.libraries.formula.EvaluationException:LibFormulaErrorValue{errorCode=522, errorMessage=NA}

    The Value type of the new column created is 'Number'. How to represent null in a 'Number'???
    Last edited by Ponb; 10-04-2011 at 12:37 AM.

  4. #4
    Join Date
    Jan 2006
    Posts
    245

    Default

    In these cases I usually prefer to use the javascript step and assign the null directly to the variable I need. I had some trouble in the past using the NA() function.

    S.
    Follow Me on Twitter: sramazzina
    My Skype account: sramazzina
    My Blog
    View my profile on LinkedIn: http://www.linkedin.com/in/sramazzina
    Author of Pentaho Data Integration Kitchen How-To and Pentaho Business Analytics Cookbook

    Join us on IRC server Freenode.net, channel ##pentaho ##saiku

  5. #5
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    that sounds like a bug then. Probably worth raising a jira, and as suggested using the javascript step instead.

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.