3

In QGIS, I have a point layer. I'd like to create a new attribute that will retrieve the value from the "Name" field for the object that has the highest value in the "he" field in each "ID" group. What expression can I use?

enter image description here

1
  • 1
    What have you tried so far? Commented Oct 17 at 10:01

1 Answer 1

1

The array_agg() function contains all you need. It takes all values form Name field, groups them by the value from ID field and filters the feature where the field he has the largest value:

array_agg ( "Name", group_by:="ID", filter:= "he" = maximum ("he", group_by:="ID") )[0] 

enter image description here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.