How can I select all those features that has exact same values in their attribute field called "X"? I think that the solution could be something like the Countif function in Excel, but I haven't found such function in QGIS. I know that there is the Group Stats plugin, but I would like to select values and later work with them.
-
You want to select all objects with specific value for example 5 or every object which is not unique in column X? – ami Nov 13 '16 at 21:27
-
Every object without unique values – Skye Nov 13 '16 at 21:29
-
1Similar issue here: http://gis.stackexchange.com/questions/27822/identifying-duplicate-attributes-in-field-using-qgis – ami Nov 13 '16 at 21:37
-
What GIS do you mean? In arcmap, it would be Select by Attribut, which is under Selection. – Tom Kaltofen Nov 13 '16 at 21:03
-
I mean QGIS (tagged) – Skye Nov 13 '16 at 21:06
-
http://qgis.spatialthoughts.com/2012/02/tutorial-selecting-multiple-features-in.html – Tom Kaltofen Nov 13 '16 at 21:14
-
To give a more detailed sketch: If the field called "X" contains the value '6' three times, value '3' two times, value '7' two times and values '2' , '10', '21' only once, then the seven rows with 6,3 and 7 should be selected. – Skye Nov 13 '16 at 21:28
3 Answers
Use function Select features using an expression (
icon in main panel or in attribute table). In expression window type :
"your_field" = 'value'
Reacting to your detailing comment:
You can chain your expression with logical operators like: AND, OR ... so in your example it can be:
"your_field" = 'value' OR "your_field" = 'value2'
When you finish writing expression hit Select button.
Expression window:
In this window you can olso browse layer attributes, their values, operators, functions etc.. For more info see Selecting features in an attribute table in QGIS documentation.
- 6,895
- 3
- 29
- 50
-
I am familiar with these basic selections, but I don't know what is the solution if I have thousands of records and I have no idea that which values have duplicates. @ami shared the link (http://gis.stackexchange.com/questions/27822/identifying-duplicate-attributes-in-field-using-qgis) that describes my problem. – Skye Nov 14 '16 at 23:00
On QGIS 2.16 or later just select your layer and then press f3. You'll get an easy dialog for selecting features by attribute.
- 27,620
- 3
- 61
- 85
Use function Select features using an expression
icon in main panel or in attribute table. In expression window type (replacing field_with_dupes with your field name):
count("field_with_dupes", "field_with_dupes") > 1
- 2,294
- 13
- 21
