Skip to content

Instantly share code, notes, and snippets.

@mountaindude
Created October 7, 2015 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mountaindude/49c7c5395848e86b4fbf to your computer and use it in GitHub Desktop.
Save mountaindude/49c7c5395848e86b4fbf to your computer and use it in GitHub Desktop.
QlikView / Sense code mapping US states to regions and divisions
// Load US high level regions (easter, southern, midwest etc) and divisions
// From https://en.wikipedia.org/wiki/List_of_regions_of_the_United_States
// Could also use https://www.npac.com/the-npac/about/npac-regions if more granularity is needed
US_States:
NoConcatenate Load
[State code],
[US census region],
[US census division]
Inline [
State code,US census region,US census division
AL,South,East South Central
AK,West,Pacific
AZ,West,Mountain
AR,South,West South Central
CA,West,Pacific
CO,West,Mountain
CT,Northeast,New England
DE,South,South Atlantic
DC,South,South Atlantic
FL,South,South Atlantic
GA,South,South Atlantic
HI,West,Pacific
ID,West,Mountain
IL,Midwest,East North Central
IN,Midwest,East North Central
IA,Midwest,West North Central
KS,Midwest,West North Central
KY,South,East South Central
LA,South,West South Central
ME,Northeast,New England
MD,South,South Atlantic
MA,Northeast,New England
MI,Midwest,East North Central
MN,Midwest,West North Central
MS,South,East South Central
MO,Midwest,West North Central
MT,West,Mountain
NE,Midwest,West North Central
NV,West,Mountain
NH,Northeast,New England
NJ,Northeast,Mid-Atlantic
NM,West,Mountain
NY,Northeast,Mid-Atlantic
NC,South,South Atlantic
ND,Midwest,West North Central
OH,Midwest,East North Central
OK,South,West South Central
OR,West,Pacific
PA,Northeast,Mid-Atlantic
RI,Northeast,New England
SC,South,South Atlantic
SD,Midwest,West North Central
TN,South,East South Central
TX,South,West South Central
UT,West,Mountain
VT,Northeast,New England
VA,South,South Atlantic
WA,West,Pacific
WV,South,South Atlantic
WI,Midwest,East North Central
WY,West,Mountain
];
// Puerto Rico and US territories are not part of any cencus division
// AS,American Samoa,01802701
// GU,Guam,01802705
// MP,Northern Mariana Islands,01779809
// PR,Puerto Rico,01779808
// UM,U.S. Minor Outlying Islands,01878752
// VI,U.S. Virgin Islands,01802710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment