1

I am trying to use Census Block group income data that I retrieved from American Fact finder. When I join the income data to the block group shapefile in QGIS it imports as a string.

How can I convert this in to an integer?

nmtoken
  • 13,355
  • 5
  • 38
  • 87
maddog
  • 11
  • 1
  • 2

1 Answers1

1

I believe what you are looking for is answered here: Changing CSV layer attribute value from text to number in QGIS?

The answer there, by @ShepherdJo ... reads:

[...] The answer is that you put a file in the same folder with the ending csvt. For example your file name is xyzdata.csv you add the file xyzdata.csvt

This one you can edit with editor for example. And in it you set the data type like this. "Integer","String","Integer","Integer","String","Real"

Integer is now the variable for the first column, string for the second and so on... Make sure the files are named identically.

Edit: See here too if needed: http://underdark.wordpress.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/

Alternatively, if you just have one or two fields you need to convert, you can use the QGIS field calculator to convert a string to a numeric field, as described in this answer.

J. Taylor
  • 673
  • 6
  • 19