I have an Id field in a table & need to add the max id + 1 to a new set of features with the same field name
Page 1 / 1
You can use the StatisticsCalculator to get the maximum value of the Id field. However, I'm unclear what the next requirement is. Where will the "new set of features" come from?
Yes, StatisticsCalculator + ExpressionEvaluator will address this
Thanks, The second table is a subset that need the new id so that when I place them back into the first non spatial table the numbers are unique. The non spatial table will have entries from table 2 and table 3.
A possible way is:
get the maximum value of Id in the first table with a StatisticsCalculator,
merge the "max Id" to the subset features unconditionally with a FeatureMerger,
then add Id starting with (max Id + 1) to the features using a Counter.
e.g.
To merge "Id._max" to the subset features unconditionally, set an identical constant value (e.g. 1) to the Join On parameter for both Requestor and Supplier.
If the first table was stored in a database, you can also use the SQLCreator or SQLExecutor to get the maximum Id value efficiently with a SQL statement like this.
select max(Id) as maxId from first_table;