Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Nested if ... then , else if ...

  1. #1

    Default Nested if ... then , else if ...

    hi,

    i have to do 5 nested conditions. Something like:

    If field1>1 then target_field="value 1"
    else if field2>1 then target_field="value 2"
    else if field3>5 then target_field="value 3"
    else if field4<0 then target_field="value 4"
    else target_field="value 5"

    i know I can do this in javascript or the UDJE. My question is if there is a way to do this without having to write the code, i.e. using any of the steps

    thanks

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

    Default

    Of course there's a way ...
    Attached Images Attached Images  
    So long, and thanks for all the fish.

  3. #3

    Default

    Any way to do this with a single step?

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

    Default

    The question in your opening post I understood as: Is there a way with Kettle to implement nested logic besides Scripting steps like UDJE or MJSV?
    Now you want to know: Are there other single step solutions for the nested logic problem?
    AFAICS there's no way without a Scripting step like User-Defined-Java-Class, Rules-Executor, Formula (to name the other candidates).
    So long, and thanks for all the fish.

  5. #5

    Default

    Thanks

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.