How can I dissolve a polygon layer in QGIS based on a single attribute but keep all (or some) other attributes at the same time? This is how I want to retain fields:
There are at least two fields I want to retain the information from in the dissolved shapefile, one is a string, the other one is numerical.
I would like to dissolve the shapefile based on the field "Class", and I want to retain the information of columns "Object_ID" and "Signal_species"
Best Answer
It is now more than one year from your post... From QGIS 2.16, new
Aggregates
functions became available. One of the new expression isconcatenate()
.Your Sample
concatenate()
Open the attribute table and create a new text field (with enough string length), with expression:
Please note
concatenate()
takes only texts (strings), so I had to applyto_string()
to "Signal_Sp" which was integer type...After
concatenate()
your attribute table will become like below:Now we can dissolve the polygon keeping original attribute data.
I will need to delete old fields (
Object_ID
andSignal_Sp
) afterwards.