Hi @venu, if the expected IDs are 1-based sequential numbers, you can generate every ID from 1 to the maximum ID in the table with this procedure.
- StatisticsCalculator: Get the maximum ID from the table.
- Cloner: Create features for the maximum number. The Cloner adds Copy Number attribute which stores 0-based sequential number to the output features. Here, set the attribute name to "ID".
- ExpressionEvaluator: Add 1 to the number. i.e. change the base of the sequential numbers to 1.
Then, merge the original features and the generated features by the FeatureMerger using the ID as join key. The resulting features from the NotMerged port would contain your desired missing IDs.
Alternatively, if you are familiar with Python scripting, a PythonCaller would be a quick solution.
# PythonCaller Script Example
import fmeobjects
class FeatureProcessor(object):
def __init__(self):
self.ids = set(<])
def input(self, feature):
self.ids.add(int(feature.getAttribute('ID')))
def close(self):
for id in sorted(set(range(1, max(self.ids)+1)) - self.ids):
feature = fmeobjects.FMEFeature()
feature.setAttribute('ID', id)
self.pyoutput(feature)
Hi @venu, if the expected IDs are 1-based sequential numbers, you can generate every ID from 1 to the maximum ID in the table with this procedure.
- StatisticsCalculator: Get the maximum ID from the table.
- Cloner: Create features for the maximum number. The Cloner adds Copy Number attribute which stores 0-based sequential number to the output features. Here, set the attribute name to "ID".
- ExpressionEvaluator: Add 1 to the number. i.e. change the base of the sequential numbers to 1.
Then, merge the original features and the generated features by the FeatureMerger using the ID as join key. The resulting features from the NotMerged port would contain your desired missing IDs.
Alternatively, if you are familiar with Python scripting, a PythonCaller would be a quick solution.
# PythonCaller Script Example
import fmeobjects
class FeatureProcessor(object):
def __init__(self):
self.ids = set(<])
def input(self, feature):
self.ids.add(int(feature.getAttribute('ID')))
def close(self):
for id in sorted(set(range(1, max(self.ids)+1)) - self.ids):
feature = fmeobjects.FMEFeature()
feature.setAttribute('ID', id)
self.pyoutput(feature)
If you need to process all the 100 tables at once and also the possible IDs for every table are always limited to the nine numbers from 1 to 9, this workflow could be a solution.