I am trying to get a running subtotal (understanding this is different from subtotals for groups, and the rollup approach).
Tried using
Row_Number() over (order by ID_Number) as Row_Count
and nesting it in select statements and using a LEFT OUTER JOIN
on itself (which just churns).
What I am trying to get is this:
if ROW_COUNT > 1 THEN RUNNINGTOTAL = Volume_Category + (RUNNINGTOTAL for ID_Number where ROW_COUNT= ROW_COUNT(for this ID_Number*)-1)
I have a table with a list of unique "ID-Numbers" which are the focus here.