Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: nested if statement in the formula step

  1. #1
    Join Date
    Jan 2017
    Posts
    6

    Default nested if statement in the formula step

    Hi,

    I'm trying to implement the "if and" statement in the function step in Pentaho Data Integration.
    Basically, if Region is "Americas - North America" and IHC Product is not null then I want to update a new field with "Other US", else leave it blank.
    My formula is as follows:
    if(and[REGION]="Americas -North America";and([IHC Product]=""));"Other US;"")
    It looks like Pentaho does not recognize null as "". I also tried with IHC Product = null but it does not recognize the null.

    Any ideas how to get this working?

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You can check for null values using ISBLANK()
    Your formula is broken, though.
    Watch out for parser errors.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Jan 2017
    Posts
    6

    Default

    Thanks.

    I changed to if(and([REGION]="Americas -North America";and(ISBLANK([IHC Product])));"Other US";"") and it worked.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    BTW: and(ISBLANK([IHC Product])) can be simplified to isBlank([IHC Product])
    So long, and thanks for all the fish.

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.