# Subtract Elevation Values to New Field (Field Calculator)

5788
4
12-03-2014 09:09 AM New Contributor

I have a data set of cross section lines (station lines).  Each cross section has two intersection points, where the cross section intersects a flood zone boundary.  I have extracted elevation values to these intersection points, based on a DEM.  I created a new field called "ElevDiff."  Is anybody aware of an expression/function I could put into the Field Calculator that would allow me to calculate the difference in elevation between the two intersection points for each cross section?

I know I could do this in excel (absolute value of one cell minus another), but there are 14,000 cross sections, so I was trying to use model builder to automate the process (this is just one step in a complex flood zone analysis) so I wouldn't have to export anything to excel and then create more joins.

4 Replies Occasional Contributor

It sounds like you know the formula and the you have the data... What is preventing you from from putting your formula into the Field calculator? Perhaps it's that your intersection points are separate rows in your table and you need to marry them together to do the calculation? if this is the case you can run a summary statistics tool on your points to get the min value and and max value from your elevation field ,grouping them (Case) on your station line identifier. from there it should be easy to just run the field calculator on your two fields. New Contributor

I know the formula in excel; I forgot to say that I have really no experience with python or VBscript for creating expressions in the field calculator by MVP Honored Contributor

Are you asking how to subtract one column from another? Please consult the Calculate Field examples. by MVP Honored Contributor

Is the problem that you have pairs of related points (same cross-section line) in one feature class? You can run Summary Statistics, using both MIN and MAX (elevations) as the statistics types and Line ID as the case field. Then join the result back to the point feature class based on Line ID. Finally, calculate elevation difference for each point using the field calculator. 