Hi
I have requirement as below.
Source
Cash_receipt_id Amount
200 500
201 500
Lookup
Status Amount Cash_receipt_id Cash_history_receipt_id
Cleared 500 200 1000
Reversed 500 200 1001
Cleared 500 201 1002
Target (only one cash_receipt_id )
Cash_receipt_id Net receipt Amount
200 0
201 500
Can any one please let me know the logic.
Thanks
Kiran
logic implementation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 110
- Joined: Mon Jan 11, 2010 4:22 am
-
- Participant
- Posts: 41
- Joined: Sat Jun 06, 2009 11:13 pm
- Location: Kolkata
Read the input records into a transformer stage.
Now give 2 output columns:
Cash_receipt_id: Populate the input Cash_receipt_id
Amount: If Status = Cleared Then Amount Else (-1) * Amount
Now add the Amount field group by Cash_receipt_id in aggregator stage and you will get the desired output.
Note: Remember to sort on Cash_receipt_id in aggregator stage.
Now give 2 output columns:
Cash_receipt_id: Populate the input Cash_receipt_id
Amount: If Status = Cleared Then Amount Else (-1) * Amount
Now add the Amount field group by Cash_receipt_id in aggregator stage and you will get the desired output.
Note: Remember to sort on Cash_receipt_id in aggregator stage.
Nayan
-
- Participant
- Posts: 110
- Joined: Mon Jan 11, 2010 4:22 am