Solved! Go to Solution.
If [rabbi2005] <> [rabbi2012] Then Output = [rabbi2005] & " - " & [rabbi2012] Else Output = [Your_New_Field] End If
I have two fields (text) which have the land use of two different years but the area is same...Now i want to calculate the difference in a new field....How can i do that....
PS:I tried with field calculator (-) command but nothing happens...
I have two fields (text) which have the land use of two different years but the area is same...Now i want to calculate the difference in a new field....How can i do that....
PS:I tried with field calculator (-) command but nothing happens...
Check first to make sure you attributes are both the same type of data in the attribute properties.
i.e. String, Integer, ETC...
I think I understand what you mean when looking at the data I see the different values in the two fields you highlighted.ArcGIS Version 10.2.1....The combine method is good one...but is'nt there any automated process (rather then manually selecting the fields which differ) i want it to be calculated automatically with some code....Thanks
What should the difference field value be for the difference between 'Current Fellow' and 'Wheat' ???
I have written code in the past to compare string values and find the difference, but this can get a bit complicated, when comparing each character with the same positional value with the character from the other field.
Or do you want to concatenate (combine) the values where the field values differ? If so, then you just need to select the features where the values are not equal and then use the field calculator on selected features to combine them. Something like this:[<FIELD1 NAME>] & " - " & [<FIELD2 NAME>]
What type of data are you using? What version of ArcGIS?
ArcGIS Version 10.2.1....The combine method is good one...but is'nt there any automated process (rather then manually selecting the fields which differ) i want it to be calculated automatically with some code....Thanks
Have you tried an attribute query like this :
Select by AttributesFIELD NAME1 <> FIELD NAME2
Then use the field calculator to calculate and combine the fields for those selected records only. If the query works, you wouldn't need to do any custom programming, you should be able to use model builder and do it without manually selecting the fields that differ. I know the query works with SDE/SQL, and I also tested the query with a file geodatabase and it worked for me at 10.2.
Hope that helps...
If [rabbi2005] <> [rabbi2012] Then Output = [rabbi2005] & " - " & [rabbi2012] Else Output = [Your_New_Field] End If