4

In QGIS 3.28 I just want to create a row number (Column "Número") based on the date of the column on the left ("Fecha"), I'm sure it's pretty easy but I'm completely new.

@row_number doesn't work at all because the order is different.

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137

1 Answers1

6

Use this expression in Field Calculator:

array_find(
    array_agg($id, order_by:="Fecha"), 
    $id
    ) + 1

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
Babel
  • 71,072
  • 14
  • 78
  • 208