This question already has an answer here:
I have a layer (vector layer imported from a Shapefile) in QGIS 2.8.3 with a bunch of features with a single numerical attribute, 'level'. I would like to filter the features with a threshold that is a certain percentage of the maximum value. For instance, if the threshold is 20% I would like to perform an expression like:
"level" > .20 * max("level")
or more SQL like:
"level" > .20 * (select max("level") from table)
These obviously doesn't work in the query builder or expression based filter. Is there a way to do this, with a different syntax, or do I need to use a different tool?