3

I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class.

fc2.bldg_id = max(fc1.bldg_id)+1

Can this be done using the advanced field calculator? If so, what would my syntax look like? Do the feature classes need to be in the same fgdb and feature dataset?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 6, 2011 at 18:37

1 Answer 1

2

I would do this one using ModelBuilder.

The model would first use the Summary Statistics tool to create a table with a single row for the Maximum of your bldg_id from fc1.

To read that value into a variable called Value use the Get Field Value tool (new at ArcGIS 10).

You can then use a Calculate Field tool on the bldg_id field of fc2 with its Expression set to %Value% + 1. Make the Value variable a precondition to running the Calculate Field tool.

answered Apr 19, 2011 at 6:29
3
  • I'll have to play with that at 10. I resorted to keeping track of the max(bldg_id) on paper. Thanks. Commented Apr 19, 2011 at 12:21
  • Is there a way to accomplish that in 9.3? Commented Jun 10, 2013 at 16:22
  • Yes - the Get Field Value tool was not available until 10.0 but at 9.3.1 (presumably 9.3 too) it was possible to write a fairly succinct Python Script Tool that opens a SearchCursor to read the row value you are interested in. This tool could be used in ModelBuilder too. Commented Jun 11, 2013 at 11:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.