Cypher Query - Sum function for lower nodes

Give this a try, it should also work for longer paths where you may not know the depth:

MATCH (a:Production)-[*]->(secondToLast:Storage)-->(last:Storage)
WHERE NOT (last)-->(:Storage)
WITH DISTINCT secondToLast, last
WITH secondToLast, sum(last.Requirement) as req
SET secondToLast.Requirement = req
1 Like