2
votes
1answer
49 views

Randomly choosing one from multiple fields in Field Calculator of ArcGIS for Desktop?

Using the Field Calculator in ArcGIS for Desktop, I want to randomly choose one field from a list of 10 fields (strings). The Excel equivalent, which is working, is: =INDEX(A2:J2;rnd()*10+1). How ...
0
votes
2answers
70 views

ModelBuilder - How to calculate Field using part of path name

I am trying to calculate a field using part of the feature class path name (specifically, the last three characters of the geodatabase name). Is this possible? I've tried using the parse path tool and ...
0
votes
1answer
68 views

How to calculate/record attachments' file names using Field Calculator?

I have a point feature class containing attachments corresponding to jpg files (sometime more than one jpg per feature). I would like to use the "field calculator" to calculate/record a new field that ...
0
votes
1answer
92 views

Error when calculate field using VBscript or Python (slice a field)

I have an expression in VBscript that works well for labeling: Function FindLabel (field) if (INT(RIGHT(field, 2)) <> 1) then FindLabel = INT(MID(field, 8, 3)) &"-"& ...
3
votes
2answers
385 views

How to Populate new field using expression containing MAX value from another field in ArcGIS attribute table using field calculator?

I've got one field X with 10 numerical attributes (float/double). I've created a new field Y (also float/double) which I need to populate with the percentage of each record/attribute (in each of the ...
1
vote
0answers
81 views

VB Script can't run in Field Calculator

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot. Thanks for your help.
1
vote
1answer
494 views

How do you calculate a column value based on the value of another column?

I am trying to select data based on whether it starts with certain characters and then update a field. For example if [Asbuilt] starts with "WL" then do something. Here are the two methods I have ...
0
votes
0answers
331 views

How can I get shape filename in attribute field using field calculator with VBA?

I want to store ths shapefile name in an attribute field using the field calculator and visual, but can't find the way to do it. Can anyone help me, please? Thanks!!!
3
votes
3answers
458 views

How to make Field Value constant size(length) by appending zeros towards the end?

I have been racking my brain, but I can't seem to find a solution to appending my field values in my .dbf to correspond with the values of my feature's attribute table. All I need to do is to append ...
4
votes
4answers
2k views

How to concatenate numbers and add in leading zeros?

I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01. Getting to 1.9.1 is easy but can anyone help out with how to formulate it so ...
2
votes
1answer
2k views

How to combine If Then with InStr in ArcMap field calculator?

I want to write an if then in field calculator that tests if a field in the attribute table contains one of several versions of another string (the versions vary by capitalization). Trouble is, I ...
1
vote
2answers
1k views

ArcGIS field calculator: VBScript get data from previous row

When using the field calculator, how do I get data from the previous row in VBScript? In Python I'd do something like this: for index, row in enumerate(rows,start=1): row[index-1] += 5 I'm ...
3
votes
2answers
5k views

Using conditional statements in Field Calculator

I have two fields, "P_Area" and "PC_Area", whose sizes I'd like to compare in a third field, "Areas_Equal". The "Areas_Equal" field should contain a "Yes" if the other two are equal and a "No" if they ...
4
votes
2answers
5k views

If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?

we need just like the following, only with multiple records selected... have tried the "xyz" in (1,2,3,4,5) SQL code but of course VB Script wants something else. dim f2 if [field1] = "foo" then f2 ...