Hi all,

Needing help with data manipulation to show only the lines the represent the end result for an employees pay period.

Brief contexts:
An employee can be paid certain elements such as Ordinary hours, Leave hours, overtime etc.. Each row of data is made up of one of these elements.
One row per element however employee can have multiple rows per payperiod.


Where things get interesting is, employees can have additional retrospective lines, which are displayed as either a negative or positive.
A negative means that it will negate the pay element where it was previously applied.
A positive means that the value of the pay line is added to the element that was previously applied.

If you are still following then great!, if not I totally understand.

I have attached an example book of what I have done so far, which primarily consists of adding "DELETE" flags then delete the marked rows at the end, however this is
a) far too slow, when i have over 300K rows
b) not entirely the most robust solution.

The reason this won't work in a PIVOT table, is where an employee has a negative retrospective line with a different rate of pay. The only options become showing the MAX of MIN rate.