I have a big data set with a column name "CORINE" with strings in it. I want to change these individualsindividual strings into integers and put itthem into a new column, so that iI can create a raster layer out of the created values. I tried this code in the field calculator.
CASE
WHEN "CORINE" = "AG"
THEN 1
WHEN "CORINE" = "BG"
THEN 2
WHEN "CORINE" = "LW"
THEN 3
WHEN "CORINE" = "NW"
THEN 4
WHEN "CORINE" = "MW"
THEN 5
WHEN "CORINE" = "WW"
THEN 6
WHEN "CORINE" = "WA"
THEN 7
WHEN "CORINE" = "DK"
THEN 8
WHEN "CORINE" = "LN"
THEN 9
WHEN "CORINE" = "NV"
THEN 11
WHEN "CORINE" = "SU"
THEN 12
WHEN "CORINE" = "SV"
THEN 13
WHEN "CORINE" = "TM"
THEN 14
ELSE 0
END
CASE
WHEN "CORINE" = "AG" THEN 1
WHEN "CORINE" = "BG" THEN 2
WHEN "CORINE" = "LW" THEN 3
WHEN "CORINE" = "NW" THEN 4
WHEN "CORINE" = "MW" THEN 5
WHEN "CORINE" = "WW" THEN 6
WHEN "CORINE" = "WA" THEN 7
WHEN "CORINE" = "DK" THEN 8
WHEN "CORINE" = "LN" THEN 9
WHEN "CORINE" = "NV" THEN 11
WHEN "CORINE" = "SU" THEN 12
WHEN "CORINE" = "SV" THEN 13
WHEN "CORINE" = "TM" THEN 14
ELSE 0
END
But after the calculations, all the values in the new column are 00
.
What is my mistake?