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.