How can i concatenate two fields using pyculator plugin? There is any document with all pyculator functions that i can use in "field expression"?
-
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.– ePascoalCommented Dec 6, 2012 at 19:24
1 Answer
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>