Linked Questions

1
vote
1answer
524 views

Python script for if/elif condition in field calculator [duplicate]

I need some help in calculating the last column (OD_pairs.Ai_) based on the condition; if travel_cost has a value below 10, OD-pairs.Ai_ takes the value of the first column(Aij_OjFCij..) if ...
3
votes
5answers
22k views

VBScript - If/Then Statement - Field Calculator

I am trying to do a simple (or so I thought) if/then statement in the ArcGIS field calculator. I am trying to add the HydroCode field - hydologic soil codes - to an existing data set. I know what the ...
3
votes
2answers
4k views

Field calculator if and elseif statement with <Null> values in ArcGis 10.1

Trying to figure out how to get this "Headwater" column to indicate "Yes" (or 1) if the value of "NextDown_Copy" is "" and "No" (or 0) if it has any other value (eg. 7100381010). I attempted to try ...
2
votes
2answers
7k views

Writing Python script in Field Calculator in ArcGIS Desktop?

I'm a programmer, I have programmed in C#, Java, but not with Python. And I'm not a geographic worker. How can I write a python script into Field Calculator to be able to check the other column value. ...
1
vote
4answers
143 views

Creating new field in ArcGIS Desktop which contains values from two different columns with certain conditions?

Suppose I have a attribute table as shown in the image below: I have columns A and B with common FID. I would like to add a new column C, which contains the values of column A with the condition that ...
1
vote
3answers
161 views

Generate a string based on an integer range

After some initial research, I was unable to find a solution for the following issue. I'm sure there's an answer to this question already floating around here somewhere, but hopefully someone can give ...
1
vote
1answer
77 views

OpenStreetMap- Field Calculator to Merge/Flatten Layer Attributes?

I'm not sure exactly what I am asking, probably lending to my struggle to figure it out via google. I have a large polygon layer from OpenStreetMap data (openstreetmap.org). My problem is I need to ...
1
vote
1answer
115 views

Creating If Then statement in Field Calculator between 2 values? [closed]

I have a FC with a column for NEAR_ANGLE from the output of the NEAR tool. The angle is displayed in degrees (i.e. -154.67687) which is fine. I am trying to create a column, HEADING, that reads this ...
1
vote
1answer
90 views

Using an IF statement in Field Calculator

I'm trying to use an if statement in the field calculator: This is what the code looks like in Python: a= 2 FacilityID= !FACILITYID! if a%2==0: MH_ID_Calc=FacilityID[0:6] else: MH_ID_Calc=...
0
votes
1answer
43 views

VBA/Python If/then statements in Field Calculator for one column based on another not working

I know this question has been asked a hundred times on here, for example: Basic If/Then in Python Parser of ArcGIS Field Calculator? Using if/elif/else statements in ArcGIS Field Calculator? Checking ...