US and Worldwide: +1 (866) 660-7555
Results 1 to 4 of 4

Thread: How to get unique combination of rows

  1. #1
    Join Date
    Jun 2012
    Posts
    13

    Default How to get unique combination of rows

    Hi,
    I am pretty new to Kettle and have just started playing with it. I have a csv file that has EmpID, Status, and date fields(there are other fields that don't matter). I want to get only those rows in which "status" changes to ACTIV from DEACT for each "EmpID".
    Eg. (Assuming the file has been sorted on "Date")

    EmpID Status Date
    1 DEACT 2010/05/09
    2 DEACT 2011/06/11
    3 DEACT 2011/06/11
    4 ACTIV 2012/01/30
    2 ACTIV 2012/03/05 *
    2 ACTIV 2012/06/01
    2 DEACT 2012/06/02
    3 DEACT 2012/07/01
    4 ACTIV 2012/07/10 *
    1 DEACT 2012/07/30
    2 ACTIV 2012/07/30 *

    The desired output would be rows marked with *s. Any suggestions will be much appreciated.
    Thanks in advance.

  2. #2
    Join Date
    Jun 2012
    Posts
    1,452

    Default

    Hm, you marked a record for EmpID 4, that shouldn't be marked.
    There was no status change from DEACT to ACTIV for that record.
    Attached Files Attached Files
    Last edited by marabu; 08-01-2012 at 01:42 PM.
    pdi-ce-4.3.0-stable
    OpenJDK IcedTea 2.3.7 (7u21)
    ubuntu 12.04 LTS (x86_64)

  3. #3
    Join Date
    Jun 2012
    Posts
    13

    Default

    Thanks a lot. Bad mistake on marking 4th. Sorry.

  4. #4
    Join Date
    Jun 2012
    Posts
    13

    Default

    This is awesome man. I can't try it now with the actual data as it would be a part of a bigger transformation.

    Thank you so much for the quick reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •