Linked Questions

1 vote
1 answer
588 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 ...
user avatar
  • 35
0 votes
0 answers
20 views

Calculating Field from text to integer using ArcMap [duplicate]

I'm using ArcGIS 10.7 trying to calculate a speed field (for my data of roads in California) really simply such that roads = 45 and highways = 65. I know I need to use an if then statement but I'm not ...
user avatar
3 votes
7 answers
32k 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 ...
user avatar
3 votes
2 answers
6k 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 ...
user avatar
2 votes
2 answers
9k 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. ...
user avatar
  • 391
1 vote
4 answers
199 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 ...
user avatar
  • 15
1 vote
3 answers
172 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 ...
user avatar
  • 527
1 vote
1 answer
208 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 ...
user avatar
0 votes
1 answer
174 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 ...
user avatar
1 vote
1 answer
92 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 ...
user avatar
1 vote
1 answer
128 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=...
user avatar
  • 11