I can't match your sample data and required output based on your narrative.
But it seems you don't need recursion, a simple OLAP function might be enough:
SELECT
SUM(tot_cost + tot_retail + tot_units)
OVER (ORDER BY weekdayofyr
ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING),
SUM(cost) AS tot_cost,
SUM(retail) AS tot_retail,
SUM(units) AS tot_units,
weekdayofyr
FROM tab
GROUP BY weekdayofyr
ORDER BY weekdayofyr
Dieter
I can't match your sample data and required output based on your narrative.
But it seems you don't need recursion, a simple OLAP function might be enough:
Dieter