Skip to main content
added 66 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

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"))
)
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"))
    )

NoteNote 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.

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.

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.

Source Link
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.