You can use a Counter followed by a Sampler to sample the last feature, this feature will hold the feature count, use this to set the variable. I guess the statistics calculator would also work.
You just need to repeat the same process before writing along with a tester to test the count against the variable.
You'll need to make sure the variable is set before any features reach the variable retriever. A FeatureHolder can help here.
Just be aware that VariableSetter/Retriever do not play well with partial runs and FeatureCaching
You can use a Counter followed by a Sampler to sample the last feature, this feature will hold the feature count, use this to set the variable. I guess the statistics calculator would also work.
You just need to repeat the same process before writing along with a tester to test the count against the variable.
You'll need to make sure the variable is set before any features reach the variable retriever. A FeatureHolder can help here.
Just be aware that VariableSetter/Retriever do not play well with partial runs and FeatureCaching
so what you are proposing is something along the lines of the following:
I did find and use a FeatureCounter from the FME Hub that adds the total record count to each row. This is ran twice and two fields are added; startCount and endCount. The Tester looks at the first record and compares the two fields to confirm they are the same value. I also added a FeatureHolder to delay writing and allow for termination, if needed before writing.
so what you are proposing is something along the lines of the following:
I did find and use a FeatureCounter from the FME Hub that adds the total record count to each row. This is ran twice and two fields are added; startCount and endCount. The Tester looks at the first record and compares the two fields to confirm they are the same value. I also added a FeatureHolder to delay writing and allow for termination, if needed before writing.
Yeah nice! In this set up you probably also don't need the FeatureHolder because the terminator *should* always be triggered first. But as a just in case it's nice to have. If you find the process to slow or is using too much memory you can look at removing it