Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Compare fields and update a flag in kettle

  1. #1
    Join Date
    Aug 2013
    Posts
    132

    Default Compare fields and update a flag in kettle

    Hi All,

    I have a table consisting 3 date columns in it. I need to compare all the 3 date columns and set the flag fileds.

    if date1=date2=date3 set flag1= true
    if date1=date2 and not= date3 flag2=true
    if date1=date3 set flag3=true
    if date2=date3 set flag4=true

    How can I achieve it and update my flag columns in the same table.

    I have to ensure that flag columns and Date columns reside in same table.

    Please help. Thanks in advance.

    Thanks,
    Malibu

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Why don;t you write a SQL UPDATE statement?
    -- Mick --

  3. #3
    Join Date
    Aug 2013
    Posts
    132

    Default

    Hi Mick,

    How to use that step.

    Ca you please explain.

    thanks in advance.

    malibu

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    If everything is in the same SQL database, I would not use PDI, but create a sql update statement.
    For more info, google for "SQL UPDATE" and specify which database you're working with (MS, MySQL, Postgre...)
    -- Mick --

  5. #5
    Join Date
    Aug 2013
    Posts
    132

    Default

    Hi Mick,

    I was able to make the changes using sql execute step.
    Thanks for your kindly help and time.

    Thanks,
    malibu

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.