I would like to convert a list of country codes into numerical values to use in regression analysis. For examples all country codes that say "US" get 1, "DE" get 2, "FR" get 3 etc. without using 'distinct'.
I tried the cast function:
cast(countrycode as numeric(1))
But it didn't work and I don't want to do it in Excel with the IF-function for 7000 values.
I already have a list of country codes. I just want to join numeric values against it so when I retrieve the data, it shows like:
US | 1
FR | 2
DE | 3
US | 1
NL | 4
FR | 2
For 144 (distinct) country codes..