Finding minimum value of different columns using QGIS?

Simply use Field Calculator and create new field with

min(A,B,C)

where A, B, C, are field names

enter image description here

If you need to keep the field (min_ABC) updated, set the expression to default value of the field. It can be done in Attributes Form setting in Layer Properties. Scroll down in the right part of window fill the default value and check Apply default value on update. Than it will automatically update when you change the values, and also works on new features.

enter image description here

Notice that this will work only on update not if you fill the values in the process of creating feature.

enter image description here


Tested on QGIS 2.18 and QGIS 3.4

In case if you do not want to modify your original data than I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer...

Let's assume we have three features in "layer" with three values accordingly, see image below.

input

With the following Query, it is possible to achieve the result

SELECT l.*, MIN(l.Value1, l.Value2, l.Value3) AS MIN_VALUE
FROM layer AS l
GROUP BY l.id

The output Virtual Layer will maintain initial attributes and geometries and additional field 'MIN_VALUE'.

Output

Tags:

Qgis

Table