I have a sparse graph that looks like this

Cosnider the first continuous 7 points as p1,p2,p3 ... p7
I want generate a new graph with every point in that graph are as follows
- p1 = p1
- p2 = p1+ p2
- p3 = p1+p2+p3
- p4 = p1 + p2 + p3 + p4 ...
- p7 = p1 + p2 + p3 + p4 + p5 + p6 + p7
To generalize formula, current point = current_point + Sum(previous_points)
I'd like to perform the above operation for all the continuous point in my sparse graph, can we use cloudwatch metric math to do so ?