Skip to main content
I need to build a list of new records that have the NEXT value for an alphanumeric primary key attribute. Thus, I need to fetch the largest value ( in the form 'ADR000xxxxxxx' where "xxxxxx' is a strictly ascending list of non-zero intergers) from one feature class and populate another (temporary) feature class starting with *that* value +1 .

 

 

Thus, let's say my ADDRESS feature class has the largetst MXADDRESSCODE = 'ADR000521327'

 

And I need to create, for instance, 4 more records. So I need to fetch the above 'ADR000521327', add one to the first, making it 'ADR000521328' and continue with 'ADR000521329, 'ADR000521330, etc. in my temporary feature class named ADDR_WORK.

 

I have looked at Sorter, ExpressionEvaluator, AttributeFilter, StringConcatenator, and others, but just can't seem to turn the corner on this one.

 

 

Thanks

 

 
Hi,

 

 

Hope this procedure works as expected.

 

(1) Select a feature which has the maximum ADRESSCODE with a Sorter (Order: Descending of ADRESSCODE) and a Sampler (Sampling Type: First N Features, Sampling Amount: 1).

 

(2) Extract integer number part from the value with a SubstringExtractor (Start Index: 3, End Index: -1).

 

(3) Create the required number of copies of the feature with a Cloner. The Copy Number Attribute called "_copynum" by default will store 0-based sequential number.

 

(4) Add (@Value(_copynum)+1) to the value with an ExpressionEvaluator.

 

(5) Restore the original format ("ADRxxxxxxxxx") with a StringFormatter and a StringConcatenator.

 

 

Takashi

Reply