So I can use the @row_number function to number sequentially but I want my start value to be 27, not 1. Is there some bit of code i need to use, where I can change the start value?
-
2What software are you using? What have you tried so far?– lambertjCommented Mar 28, 2018 at 19:06
-
QGIS 3.0 i know how to do it in ESRI, but can't see how to change the starting value from 1– Robin LCommented Mar 28, 2018 at 19:13
-
@row_number + 26– cskCommented Mar 28, 2018 at 19:40
Add a comment
|
2 Answers
You can do this with python parser
rec=0
def autoIncrement():
global rec
pStart = 1 #adjust start value, if req'd
pInterval = 1 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec
Then type the name of the function into the textbox below the code block:
autoIncrement()
Source: https://support.esri.com/en/technical-article/000011137
-
This appears to be for ArcGIS rather than the requested QGIS. Also, it is always good (and expected) to credit those that you copied and pasted their code: e.g. support.esri.com/en/technical-article/000011137.– Aaron ♦Commented Mar 28, 2018 at 19:29