AcctSolver
Technical User
I am trying to develop an extended price for an order report. The hitch is that a single order line may refer to a single quantity of one product that needs to be split out into four or more different ledger accounts.
Here is an example of some data, as I want it to display.
OrderNo OrderLineNo Sequence LedgerAcct Qty UnitPrice Amount Product
123 1 1 53101 1 1,025.00 256.25 998
123 1 2 53601 1 1,025.00 256.25 998
123 1 3 54932 1 1,025.00 256.25 998
123 1 4 58314 1 1,025.00 256.25 998
124 1 1 53101 2 150.00 300.00 999
125 1 1 53601 1 350.00 350.00 555
125 2 1 54932 4 50.00 200.00 852
This is how it does look
OrderNo OrderLineNo Sequence LedgerAcct Qty UnitPrice Amount Product
123 1 1 53101 1 1,025.00 1,025.00 998
123 1 2 53601 1 1,025.00 1,025.00 998
123 1 3 54932 1 1,025.00 1,025.00 998
123 1 4 58314 1 1,025.00 1,025.00 998
124 1 1 53101 2 150.00 300.00 999
125 1 1 53601 1 350.00 350.00 555
125 2 1 54932 4 50.00 200.00 852
What formula for Amount would I need to create in order to have it work so for every combination of OrderNo and OrderLineNo, if there is only a Sequence 1, then Amount = QTY*UnitPrice. If there is more than a sequence one, the count the number of sequences, then take (1/sequence count)*Qty*Unit Price.
Here is an example of some data, as I want it to display.
OrderNo OrderLineNo Sequence LedgerAcct Qty UnitPrice Amount Product
123 1 1 53101 1 1,025.00 256.25 998
123 1 2 53601 1 1,025.00 256.25 998
123 1 3 54932 1 1,025.00 256.25 998
123 1 4 58314 1 1,025.00 256.25 998
124 1 1 53101 2 150.00 300.00 999
125 1 1 53601 1 350.00 350.00 555
125 2 1 54932 4 50.00 200.00 852
This is how it does look
OrderNo OrderLineNo Sequence LedgerAcct Qty UnitPrice Amount Product
123 1 1 53101 1 1,025.00 1,025.00 998
123 1 2 53601 1 1,025.00 1,025.00 998
123 1 3 54932 1 1,025.00 1,025.00 998
123 1 4 58314 1 1,025.00 1,025.00 998
124 1 1 53101 2 150.00 300.00 999
125 1 1 53601 1 350.00 350.00 555
125 2 1 54932 4 50.00 200.00 852
What formula for Amount would I need to create in order to have it work so for every combination of OrderNo and OrderLineNo, if there is only a Sequence 1, then Amount = QTY*UnitPrice. If there is more than a sequence one, the count the number of sequences, then take (1/sequence count)*Qty*Unit Price.