Hi @samuelvaldez have you tried grouping the two counts via a common value and using the group by setting in the statistics calculator ?
Use another FeatureMerger with a dummy merge criteria, e.g. 1 = 1. As long as the two counts are named differently you should end up with one feature with both attributes. It is then simple to use a Tester to check for equality.
Example:
Yes, there are a few solutions. The general flow of features in FME means everything is separate, and the Tester only tests one feature at a time. So you don't test feature 1 against feature 2 in a Tester.
Some solutions:
1 - as mentioned, merge the information onto a single feature using the FeatureMerger, then a Tester
2 - use the FeatureMerger but merge by count. If the features merge, they are a match. If not, not.
3 - Use a transformer that accepts two features for comparison, for example the ChangeDetector.
4 - Use "Adjacent Feature Attributes". In an AttributeManager turn that on. Then you can say diff = count - count[-1] if the result is zero, then there is a match
I have a variation on the question above. I have a Parcel feature class in a Parcel Publishing feature dataset in our enterprise ArcGIS/SQL geodatabse that is truncated and recompiled nightly based on data in our Parcel Fabric using a combo of py and fme and Windows Task Scheduler. One of the scripts failed this week and incomplete data was written to the output dataset. Can’t have that happen again! I want to build a failsafe into my scripting that would:
- Compare record counts from the old data and the new data
- If the counts are beyond a threshold (say + or - 50 records), do not write the new output
Right now, because FME 2017 (to my knowledge) can’t work with Parcel Fabric feature classes, I have py scripting that compiles the new data to a file gdb and the fme scripting does the truncate and replace steps. Suggestions for adding the above failsafe to my fme script?
Here are my software and db details:
- FME Desktop 2017
- ArcGIS 10.4.1
- SQL Server 2014