Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mahichowdary
Contributor II
Contributor II

How to find fifo order ?

Hi All,

I need Small help from you.

This is my Requirement.

TypeIdDateAmount
Rec11/4/20155000
Rec21/5/20156000
Pay11/6/20152000
Rec31/7/20151000
Pay21/8/20158000

In Above table i want to fifo order in Script level.

this is my output:

 

Rec IDPay IDAmount
112000
123000
225000

How to solve this problem.very urgent..

Waiting for u Answer..

Thanks

Mahendra

5 Replies
MK_QSL
MVP
MVP

Can you explain the logic of fifo you have used ?

Where you got Rec ID and Pay ID?

mahichowdary
Contributor II
Contributor II
Author

Hi Manish,

Actually i have to rec amount 5000 but i have pay amount 2000, remaining 3000 is there.In Pay and rec as same id=1 and comes to pay id=2 in 8000 is there.it will pay 3000 in  same rec  id=1 but remaining amount is 5000  is there .here rec id =1 is complete.then come to rec id=2 under rec id=2 in amount is 6000 but i have to pay only 5000 in pay id=2,remaining 1000 is remainder.and so on...

mahichowdary
Contributor II
Contributor II
Author

it is an interview purpose..plz let me..

MK_QSL
MVP
MVP

But what you explained is not matching with your output !

Can you try yourself in excel to get the same output and please attach excel file here.

mahichowdary
Contributor II
Contributor II
Author

k sure...i will do it ....

Thank you so much  for replying...