I found a similar question on this site and the answer suggested:
array_find(
array_distinct(
array_agg("PortCluster_ID")
),
"PortCluster_ID"
) + 1
but using this expression gives me the following result (group1)
What I want to do is have what I wrote in white color on the attached image. As you can see I have consecutive "PortCluster_ID"s ordered in time, and i have a group of 119, then a group of 111 and then a group of 119 again, for this second group of 119 I want to have a new "ID".
What this data represents is fishing trips in and out of ports, some trips end in the same port (same "PortCluster_ID") but are obviously a different trip (ordered in ascending time).




Add autoincremental field? The tricky part is to group fields, partially based onPortCluster_ID, partly onGpsTime. – Babel Dec 13 '21 at 08:44