Bug report #20990
|Affected QGIS version:||3.4.3||Regression?:||No|
|Operating System:||W10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28809|
The instruction row_number works fine in field calculator but the same instruction doesn't work in "attribute form".
#2 Updated by Cesar Herrera almost 5 years ago
Nyall Dawson wrote:
That's because it has no meaning there -- there's no row to take the number from. Try $id instead.
Thanks Nyall for your fast answer. $id Is not a good option because working with geopackage fid is authomatic and if you delete any row, the number will not be consecutive (let me try to show you and example. I need to automatise a consecutive id in a point layer. I need as shown in @row_number: 1 2 3 ):
First you create 5 points: fid will be: 1 2 3 4 5 and @row_number will be: 1 2 3 4 5
Then Delete 3 and 4. fid will remain: 1 2 5 but @row__number will be: 1 2 3