AnsweredAssumed Answered

how to create a correlative, based on a start number (script field calculator)

Question asked by malhersa on May 18, 2020
Latest reply on May 19, 2020 by jborgion
I try to create a script, which generates a correlative number (ID)
the start number can vary,
will not start from 1 or 0
it can be any number start  and the number of rows can also change
done this example but it didn't work
rec=0
def autoIncrement():
    global rec
    pStart = 11 #adjust start value, if req'd
    pInterval = 5 #adjust interval value, if req'd
    if (rec == 0):
        rec = pStart
    else:
        rec = rec + pInterval
    return rec
expression
autoIncrement(ID)
expected result------------
ID
11
12
13
14
15
(sorry my bad English)Thank

Outcomes