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?

  • 2
    What software are you using? What have you tried so far? – lambertj Mar 28 '18 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 L Mar 28 '18 at 19:13
  • @row_number + 26 – csk Mar 28 '18 at 19:40

To increase the starting value of a variable, use addition.

@row_number + 26

enter image description here


You can do this with python parser

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   
  rec = rec + pInterval   
 return rec  

Then type the name of the function into the textbox below the code block:


Source: https://support.esri.com/en/technical-article/000011137

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.