I would like to select those features which share the same "Stand ID" in a group to dissolve the geometry afterwards in QGIS 3.1. My Attribute table looks like this:

Group Stand-ID
1      5 <-- Duplicate
1      6
1      5 <-- Duplicate
1      2
2      8 
2      9
2      5
3      3
3      4

How would the corresponding expression look like in QGIS? Group by "Group" > select everything which is not unique

2 Answers 2


The QGIS Dissolve algorithm should fix this for you.

  1. Start the Dissolve algorithm from the Processing Toolbox (or the Vector-> Geoprocessing Tools menu).
  2. Select your data set as Input layer
  3. Click on the ... button to the right of the Dissolve field(s) field to open the Multiple selection widget.
  4. Check/tick both Group and Stand-ID in the Multiple selection widget, and then click the OK button to close the widget.
  5. Click run

In the output layer, features that have the same Group, Stand-ID combination have been dissolved.


I'm not sure my solution is very nifty but you can try the following.

Add a virtual field in your table using this expression :

if(count("stand_id", "group"||"stand_id")>1,"group"||"stand_id",'0')

That should detect any (group, stand_id) duplicate among groups.

You should then be able to base your dissolve operation on that virtual field.

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.