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.

How can i concatenate two fields using pyculator plugin? There is any document with all pyculator functions that i can use in "field expression"?

share|improve this question
    
To be more precise in my question what i'm trying to say is to update an field (field1) which is varchar type from another one (field2) wich have the same type. The problem is that i can't use the classic update field that qgis have by default because these fields are connected from an postgis database. So if i try: Value = <field1> + <field2> it gives Error index: list index out of range. –  ePascoal Dec 6 '12 at 19:24
add comment

1 Answer 1

If you have three fields: field1, field2, field3 and you want to concatenate the values from the first 2 into the third you would select field3 in the dropbox at the top of the plugin's window then double click the first field, press +, then double click the second field. The field expression box should look like this:

value =  <field1> + <field2> 

Then click Run and you're done.

Edit: If the field's aren't strings you'll need to convert them using python's str() function. If field1 is an integer field the example would be:

value =  str(<field1>) + <field2> 
share|improve this answer
add comment

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.