Skip to main content
1 of 2
MrXsquared
  • 35.6k
  • 22
  • 71
  • 121

Something like this:

if(
array_min(array("a","b","c"))
<
array_min(array(
attribute(get_feature_by_id(@layer,$id-1),'a'),
attribute(get_feature_by_id(@layer,$id-1),'b'),
attribute(get_feature_by_id(@layer,$id-1),'c')
))
,
array_min(array(
attribute(get_feature_by_id(@layer,$id-1),'a'),
attribute(get_feature_by_id(@layer,$id-1),'b'),
attribute(get_feature_by_id(@layer,$id-1),'c')
))
,
array_min(array("a","b","c"))
)

Note that depending on your exact requirements you may want to use get_feature() instead of get_feature_by_id(). In my example no gaps in the id's are allowed.

MrXsquared
  • 35.6k
  • 22
  • 71
  • 121