Skip to main content
Question

Can you build a list a numbers based on two fields?

  • July 25, 2019
  • 1 reply
  • 6 views

lobsterboy

I am looking to make lists based off of attributes that have i currently have.

 

For example (photo below), I am looking to build a list between Field1 and Field2.

For example in the first row _list{0} = 40, _list{1} = 41, _list{2} = 42, ... _list{10} = 50.

 

1 reply

takashi
Evangelist
  • July 26, 2019

Hi @lobsterboy, a possible ways is:

0684Q00000ArLJCQA3.png

Alternatively, a PythonCaller with this script is also available.

def processFeature(feature):
    s = int(feature.getAttribute('Field1'))
    t = int(feature.getAttribute('Field2'))
    for i, n in enumerate(range(s, t + 1)):
        feature.setAttribute('_list{%d}' % i, n)

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings