Question

FeatureJoiner return counts


Hi, I'm working on a workbench to report on changes made to a data set.

 

I have a database table with a column of unique IDs. I store a previous copy of the IDs so I can compare current against previous.

Using a FeatureJoiner I can establish NEW/DELETED IDs - brilliant......

The issue is that I may not have Unjoined Left/Right every time so at the moment my workbench doesn't proceed.

I need to get to the point where the workbench can continue/report even if either/or both are null. Is FeatureJoiner the best transformer?

Any ideas?

 

Thanks

 


3 replies

Userlevel 2
Badge +16

You could use a StatisticsCalculator before and after the FeatureJoiner to get the number of records in the "before" and in the "joined after" and compare the two to check if all records are joined.

But that will slow down your transformation a bit.

Hope this helps.

Badge +2

Hi @stevejames,

I'd recommend taking a look at the NoFeatureTester custom transformer. This transformer will checks whether the connected ports have any features, if they do not it will pass through the NOINPUT output, which you can then incorporate into your workspace logic.

Alternatively if you haven't already I'd look at the ChangeDetector transformer as opposed to the FeatureJoiner - rather than having Joined/Unjoined, you can set the attribute to match on an attribute (ID) in your original and revised dataset, and this has an output port for Inserts/Deletes and unchanged, so may be better matched for your use case.

Thanks @hollyatsafe. I will take a look at the NoFeatureTester.

 

I managed to get it working as follows.

As I get a single feature from a Creator I added in a new attribute for both Left and Right side of the joiner to force at least 1 Unjoined Left and 1 Unjoined Right.

This means that I will always get at least a count of 1 for both output ports.

Once I calculate statistics I can simply reduce the count by 1 on both sides (ie added/removed).

Done!

Reply