Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation based on Assumptions

Hello to All,

I am trying to perform a complex calculation which is based on an Assumption as per company policy.

For this, we have two tables: one for receiving transactions and other for consumption transactions.

Receiving Trans:

         DateItemRec Qty
Excisable
Jan/02/2014ACB500Yes
May/02/2014ACB300No
Jan/03/2014ACB200No
Jan/03/2014ACB200Yes
Feb/08/2014ACB1000No
Mar/08/2014ACB10No
Apr/08/2014ACB1550Yes
May/03/2014ACB500Yes
Jun/03/2014ACB30No
Jul/03/2014ACB40Yes
Aug/04/2014ACB100Yes
Sep/05/2014ACB450No
Oct/02/2014ACB305Yes
Nov/02/2014ACB100No
Dec/02/2014ACB50Yes

Consumption Trans:

ItemIssued QtyDate
ACB300Jan/02/2014
ACB300May/02/2014
ACB150Jan/03/2014
ACB190Jan/03/2014
ACB800Feb/08/2014
ACB40Mar/08/2014
ACB50Apr/08/2014
ACB430May/03/2014
ACB30Jun/03/2014
ACB40Jul/03/2014
ACB80Aug/04/2014
ACB300Sep/05/2014
ACB150Oct/02/2014
ACB200Nov/02/2014
ACB130Dec/02/2014

As shown above, consumption table do not have 'Imported' Flag. But Company assume that first they will consume 'Excisable' qty and after this 'un-excisable' qty.

Now the requirement is that, we have to calculate month wise opening & closing stock for 'Excisable' and 'un-excisable' Qty. If Excisable qty is not available in stock then it will show zero balance.

For Example, available Excisable stock should be as follow:

Month       Item       ExcisableStok Qty

-------------------------------------------------------------

Jan-2014     ACB       60

Feb-2014     ACB       0

Mar-2014    ACB         0

Apr- 2014    ACB       1500

-----------------------------------------------------------

Please provide your suggestion to accomplish  this.

Thanks in Advance

0 Replies