# Add the lengths of columns with the same id in arcmap

I have a polyline dataset that contains a unique feature (manhole) and the lines segmented by outflows from it. I need to get the distance from the manhole to each break on the line.

So in the MH Column I want

``````1 = 2.029
2 = 1+2 = 37.19~
3 = 1+2+3 = 58.3~
4 = 1+2+3+4 = 88.6~
a =20.31.62
b = a+b = 56
``````

It doesn't seem as if I can use summary stats.

I can get the MH_Order to be MH_ID+SequentialNo. So it's SSG015-06_1, SSG015-06_2 etc instead of SSG015-06_676, SSG015-06_679 etc.

But the critical factor is how to I get it to do 1=1, 2=1+2, 3=1+2+3 etc? should be in field calculator python

• You have an ArcPy tag but have not presented a code snippet. However, it sounds like you are wanting to use the Python Parser of the ArcGIS Field Calculator so I will retag your question for that. – PolyGeo Aug 29 '16 at 2:59
• @PolyGeo I didn't know how to start the code for this...but yes python parser in field calculator would be ideal or an arcpy tool if it is to complex to do in the field calculator. – GeorgeC Aug 29 '16 at 3:54
• Linear referencing will do the job providing your pipes digitised correctly, I.e. they start at from manhole – FelixIP Aug 29 '16 at 4:38
• You will need to network the data and get directions into the lines then for each manhole/junction do a downstream trace... this is tedious and time consuming. What do you want these values for? How do you intend to store them? it can't be in the lines or junctions as each line or junction can have multiple values. Water utility toolbar has been a valuable resource to me previously solutions.arcgis.com/utilities/water/help/network-editing but I don't know if it's still 'free'. – Michael Stimson Aug 29 '16 at 4:38
• @FelixIP are you talking about the locate features along the route tool? Do you think I would need to make the original lines dataset into a route? The critical thing is getting the distance from the manhole to the branch point. Thinking about this again we may be able to simply use the xy of the end of the line and calculate distance to the manhole. – GeorgeC Aug 29 '16 at 5:15