QGIS Attribute Table – Selecting Values of Variable in Attribute Table with Specific Character in QGIS

attribute-tablefloatingqgisselect-by-attributeselect-by-expression

I have a shapefile of a grid cell. I would like to select all the observations (cells) whose values in column "mean" is not an entire number. I was thinking to do it selecting all the observations which contains a point "." but I am still not able to do it. I am open to other ways to do it.

The main objective of this is to see all the selected observations in the map (together with observations no selected) to correct them manually. I need to see them in the map with the rest of the observations in order to know how I should correct them.

I attach a screenshot of my Attribute Table, whose column _mean is the one I am interested in. As you can see, some values are entire but others are decimals. I would like to select all the decimals observations (of variable _mean) and to see in the map all the selected observations together with the no selected ones.

enter image description here

[Edit: I attach a screenshot of the data type of field _mean]

enter image description here

Best Answer

One can use this "Select by expression" tool together with this function regexp_match():

regexp_match("mean",'^[0-9]+$') != 1

result

Note: This expression will work for both: field of a Real type ("mean") and field of a String type ("mean2").

For selecting just a dot . in the field one can use the following expression:

regexp_match("mean2",'\\.') > 0 # otherwise regexp_match("mean2",'\\.') = 0

References:

Related Question