• Sorry for this double post...i didn't realize it went to another page and thought it didn't go thru the first time.

    GrassHopper (11/26/2014)


    In the attachment I will explain what that means:

    The volume in Cell K, I get by using this query:

    Select SUM(Calc_line_net_amount) as volume,GroupID,[Include]

    from [PRGX_AS_CC_SandBox_Rebates_2013].[dbo].ClaimTank

    Group by GroupID, [Include]

    Having Include <> 0

    order by GroupID

    From another table called [DealEntry_Rebate_ClaimTank] We have the data below:

    1) Column F is a Cell D - Cell E

    2) Column G is a Running Total for each GroupID (only used for explanation purposes)

    3) The amounts in Column H for ID# 11, should really be in Column F

    4) When the Running total is going to be greater than the Volume for the groupid, then use this calculation to populate Column F. Volume - Previous Runnig total value. In this example in gray, it would be 23,891,677.19 - 499,999.00 and the result in red (23,391,678.19) would be put in column F for ID#11 (the same row it is in). I just put the total in H for showing the work.

    5) if there are more records in that groupid, then it would just be populated with NULL Values in the ToFrom.

    I only used the volume for groupid '110300163' to show an example. Hope this helps.

    Thanks!