Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thank you so much for your time.

share|improve this question

1 Answer 1

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"
share|improve this answer
    
Worked. Thank you for your time. –  KkBkk Jun 10 '12 at 18:59
1  
@KkBkk If your problem is solved, please accept the answer so that this thread can be marked as answered. Upvotes are welcome too. They are a way to reward users who donate their time to answer questions. –  underdark Jun 10 '12 at 19:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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