Skip to main content
Tweeted twitter.com/StackGIS/status/1464111677759176704
Became Hot Network Question
added 13 characters in body; edited tags; edited title
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

Change string to Getting integer based on string value in another field using QGIS

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?

enter image description here

Change string to integer QGIS

I have a big data set with a column name "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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

But after the calculations all the values in the new column are 0. What is my mistake?

enter image description here

Getting integer based on string value in another field using QGIS

I have a big data set with a column name "CORINE" with strings in it. I want to change these individual strings into integers and put them into a new column so that I 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

But after the calculations, all the values in the new column are 0. What is my mistake?

enter image description here

naming; typo; removed closing
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Change string to integer qgisQGIS

I have a big data set with a columnnamecolumn name "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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

But after the calculations all the values in the new column are 0. What is my mistake?

Cheersenter image description here

Change string to integer qgis

I have a big data set with a columnname "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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

But after the calculations all the values in the new column are 0. What is my mistake?

Cheersenter image description here

Change string to integer QGIS

I have a big data set with a column name "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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

But after the calculations all the values in the new column are 0. What is my mistake?

enter image description here

added 3 characters in body
Source Link
TomazicM
  • 27k
  • 23
  • 31
  • 42

I have a big data set with a columnname "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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 0. What is my mistake?

Cheersenter image description here

I have a big data set with a columnname "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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´´

But after the calculations all the values in the new column are 0. What is my mistake?

Cheersenter image description here

I have a big data set with a columnname "CORINE" with strings in it. I want to change these individuals strings into integers and put it into a new column, so that i 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

But after the calculations all the values in the new column are 0. What is my mistake?

Cheersenter image description here

Source Link
Mike
  • 43
  • 2
Loading