7

Sorry if this question is too simple/easy for you guys, but I'm still learning QGIS and pretty much teaching myself where I can.

Is there a way to add data from 2 columns into one new column inside QGIS ?

I have cattle population for each province in a certain country, and buffalo populations for each province in another column (I entered all these manually) - what I'm looking to do is to make a new column (within the same shapefile/database) that combines both cattle and buffalo populations in each province.

I've tried using the field calculator, get error messages all the time - not sure if I have my functions wrong. With the field calculator, I've been trying to enter a simple function of

Catt Pop + Buff Pop

with a new output field as Real number data, but I get error messages such as:

Invalid expression syntax. The error message of the parser is: 'syntax error, unexpected COLUMN_REF, expecting $end'

Secondly - if I can't do this in QGIS, is the only way to open the relevant dbf file in open office and then edit it and then save and load again? From the manual that I read to learn GIS, this can be done but is not recommended (by the guys who wrote the manual) - does anyone have any links to any foolproof guides on how to do this anyway since I've never done it?

  • how to use te calculator char CASE? thank you – user80796 Aug 15 '16 at 21:07
  • This is not an answer to the question, please ask a new question. – Mapperz Aug 15 '16 at 21:30
11

The syntax problem is most likely caused be the spaces in column names. If you double-click the column names in field calculator, they will most certainly be added with quotation marks, e.g.

"Catt Pop" + "Buff Pop"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.