Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: How to load the different targets in PDI based on multiple condition.

  1. #1
    Join Date
    Aug 2015
    Posts
    6

    Default How to load the different targets in PDI based on multiple condition.

    How to load the different targets in PDI based on multiple condition. For Example,

    Target1 will have records where Salary < 50000 and Dept_id =10 or 20 and
    Target2 will have records where Salary > 50000 and Dept_Id=30 or 40 and
    Remaining records will go to default group.

  2. #2
    Join Date
    Aug 2015
    Posts
    6

    Default I am new to PDI, can some one please let me know on how to handle partitions in SPOON

    I am new to PDI, can some one please let me know on how to handle partitions in SPOON.

  3. #3
    Join Date
    Sep 2014
    Posts
    122

    Default

    The step "Filter rows" can do this, but you may need two filter steps.

  4. #4
    Join Date
    Aug 2015
    Posts
    6

    Default

    Quote Originally Posted by chen5132649 View Post
    The step "Filter rows" can do this, but you may need two filter steps.
    Thanks Chen. This is just an example but I have 4 different conditions and using filter will be too complicated. Any way to achieve in single step.

  5. #5
    Join Date
    Feb 2013
    Posts
    530

    Default

    I hope this helps!
    ~[ATTACH]15393[/ATTACH
    Attached Images Attached Images
    Attached Files Attached Files
    - Sadakar Pochampalli

  6. #6
    Join Date
    Apr 2008
    Posts
    4,406

    Default

    Why not embed your business logic into a Formula step, and then use a switch-case to send to the appropriate Table Output?

    You actually gain a lot of understanding in the flow if you use Filter rows steps in series.


    You could also do a Switch-Case based on DeptID as your start point, then use filter rows after it. This would allow you to do:
    Dept_id =10 -> Filter (10,20) < 50K -> Target1 / False to Default
    Dept_id = 20 -> Filter (10,20) < 50K -> Target1 / False to Default
    Dept_id = 30 -> Filter (30, 40) > 50K -> Target2 / False to Default
    Dept_id = 40 -> Filter (30, 40) > 50K -> Target2 / False to Default
    Dept_id = 50 -> Filter (50) > 100K -> Target3 / False to Default
    Other Dept_id -> Default

  7. #7
    Join Date
    Apr 2008
    Posts
    4,406

    Default

    Quote Originally Posted by varsgoel View Post
    Thanks Chen. This is just an example but I have 4 different conditions and using filter will be too complicated. Any way to achieve in single step.
    If you were doing it by hand, would you be able to do it in a single step, or would you need to look at all 4 fields?
    I'd bet that you would need to look at all 4 fields, so to make your logic clear for the next person that maintains your ETL, you should make it multiple steps.

  8. #8
    Join Date
    Aug 2015
    Posts
    288

    Default

    Quote Originally Posted by gutlez View Post
    I'd bet that you would need to look at all 4 fields, so to make your logic clear for the next person that maintains your ETL, you should make it multiple steps.
    It is important for all viewers who are ready to help in this forum.

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 - 2017 Pentaho Corporation. All Rights Reserved.