Page 1 of 1

logic implementation

Posted: Tue Jan 25, 2011 3:04 am
by kirankumarreddydesireddy
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

Posted: Tue Jan 25, 2011 3:50 am
by nayanpatra
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.

Posted: Tue Jan 25, 2011 5:20 am
by kirankumarreddydesireddy
Thanks nayan




Thanks
Kiran