Reply To: PUMA GEO Codes to State Names

#6505
Bill Finzer
Keymaster

Hi Travis,

  1. Create a new attribute stateCode with the formula:
    subString(full geo codes, 2, 2).
    This extracts (as a number) the code for the state.
  2. Import into your document a dataset that has each state and its code. Let’s say its name is states_with_codes and that it has attributes code and name.
  3. Back in the original dataset create a new attribute stateName with the formula:
    lookupByKey(“states_with_codes”, “name”, “code”, stateCode)
  4. You’ll probably want to Delete Formula (Keeping Values) for both of these new attributes you’ve created.

You can actually replace step 3 with a join move. Drag the code attribute from your imported dataset on top of stateCode and release. Voilá! You’ve joined the two datasets.

Hope this helps.

Bill