Monday 31 December 2018

arcgis desktop - Use Get Field Value tool to calculate field?


I am running a summary statistic on a clip to get acre counts by area type. I want to then add a second field that has the acre count from the total area. A third field be added so that it shows as the percentage of each acre type as compared to the whole area.


First field = Summary Statistics of area type by acre count


Second field = Total acres of project area <--- This is where I am having trouble


Third field = (([first field]/[second field]) * 100)


The problem is, I am trying to get the value from the initial project area using the Get Field Value tool. I am able to do this but when using the Calculate Field tool to calculate the third field, I do not know how to get this option.



Can I set the value from the Get Field Value to a variable then in the Field Calculator use Python to call the variable? Will it recognize the variable?



Answer



You can do this in ModelBuilder using Get Field Value on your project layer (against pre-calculated area or acre field), and using in-line variable substitution within a Row Selection iterator, and calculating using field calculation on the sum stat table.


See graphics below:


enter image description here


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...