Hello All,
Need you help in calculating the credit for sales rep month by month for Orders he is working on.
Order# |
Order Status |
Initial Order Date |
Order Change Date |
Net Value |
Delta |
Payout |
|
111 |
Initial Order |
01-Jan-18 |
|
100 |
100 |
100 |
Jan Credit |
111 |
Changed |
|
01-Feb-18 |
150 |
150-100 |
50 |
Feb Credit |
111 |
Changed |
|
01-Apr-18 |
300 |
300-150 |
150 |
April Credit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
Initial Order |
01-Feb-18 |
|
20 |
20 |
20 |
Feb Credit |
222 |
Changed |
|
01-Mar-18 |
40 |
40-20 |
20 |
March Credit |
222 |
Changed |
|
01-Apr-18 |
40 |
40-40 |
0 |
April Credit |
I have created some sample data above for your reference
order 111# :
->Initial order came in the month of January and net value is 100 .100 value is considered for sales rep's commision calculation.
->There was a change in the order(order status is taken as reference) in the month of Feb. new net value is 150. So in this case Delta between the current net value and previous net value is considered for commision calculation.
->Then another changed record arrived in the month of April, So delta between April and the most previous period(Feb) is used for commision calculation.
Could you please help me to derivie this delta value between the current period and the most recent period of same orders.
The current period delta calculation should not impact any of the previos period's crediting and payout.
Thanks,
Ankit