Get text string from "RuleID" Field

1288
3
08-20-2012 09:56 AM
DWR_BuckEhler
New Contributor III
Hi,
Does anyone know of a way that I can calculate the text string that is associated with the RuleID to another field? When the RuleID field is viewed in the attribute table it is populated with text strings that describe the features being represented, when I try to calculate another field using the RuleID field, I get a bunch of integers.

If anyone knows how to calculate the text string you will be my hero.

Thanks,
Buck Ehler
Tags (2)
0 Kudos
3 Replies
AlexeyTereshenkov
Regular Contributor III
Hi Buck,

This happens because the RuleID is of Long type (i.e., integer). The text you see in the field (Rule_1 etc) is a coded value which is stored on the geodatabase level (right-click the geodatabase in Catalog and choose Properties > Domains tab).

If you want to calculate the "Rule_x" in the newly created field, I'd suggest using the Field Calculator like you do now and get the digits (1,2,3 etc) and then calculate the field by adding the "Rule_" again by using the using the Field Calculator.
0 Kudos
DWR_BuckEhler
New Contributor III
Thanks tereshenkov,
I see what you mean by concatenating the text string "Rule_" with the RuleID integer. However the coded values I have are more like "contact, well located" or "fault, normal", etc. so I don't think that would work.

Thanks for pointing out that they are coded domains though. I think I will be able to extract the coded domains table somehow and then join it to the feature class using the calculated RuleID fields and then populate the string field with the coded values from the domain.

Cheers,
Buck E.
0 Kudos
AlexeyTereshenkov
Regular Contributor III
Hi Buck,

I see.. Well, then you can indeed run the Domain To Table geoprocessing tool (under Data Management > Domains) to get a table with the original integer values (1,2,3 etc) and their descriptions ("contact, well located"). Then join these values with the feature class column you will calculate.

Good luck!
0 Kudos