2

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?

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

2 Answers 2

9

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

@row_number + 26

enter image description here

0

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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