Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Set conditional field values based on other fields

  1. #1
    Join Date
    Jun 2015
    Posts
    6

    Default Set conditional field values based on other fields

    Hello

    I am using version 5.4.0.0-128 and currently trying to wrap my head around this great piece of software.

    I have the following very simple data structure:

    ID Name Desc Qty is_in_stok
    0 Test0 bla 1 $false
    1 Test1 blu 0 $false

    How can I set the value of column 'is_in_stock' based on column 'qty'? Here is some pseudo code
    Code:
    if ($qty > 0) 
    { 
        $is_in_stock = $true
    } 
    else
    {
        $is_in_stock = $false
    }
    Thanks in advance!!

  2. #2
    Join Date
    Nov 2008
    Posts
    271

    Default

    Hi,
    Use a filter rows to split the stream on qty >0 and then use two "set field value to a constant" on the true and false hops coming from the filter step.

    HTH
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

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

    Default

    Or UDJE for the more adventurous:


    Name:  UDJE.png
Views: 1297
Size:  24.5 KB
    So long, and thanks for all the fish.

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.