Skip to main content
Solved

FeatureMerger, A ≈ B OR B = A?

  • August 28, 2020
  • 3 replies
  • 58 views

aron
Enthusiast
Forum|alt.badge.img+16

I am trying to merge some data with the FeatureMerger. There are two datasources. Merging should be done when:

AttributeA = AttributeB OR AttributeB = AttributeA

(It skips ahead if I only use one of these)

 

How do I do this? I guess I could use the text editor, but am unsure of the syntax. Or should I use the InlineQuerier for better results? Same thing there though, I don't know the correct syntax.

Best answer by bwn

If it is only 2 conditions to test, fastest performing workspace would probably be one that makes use of FeatureJoiners which do attribute indexing and bulk mode processing, although the InlineQuerier based solutions I've also found usually reasonably quick.

 

FeatureJoiner Solution like so. Note, it is important that the last FeatureJoiner is a FULL Outer join by setting the Join Mode.

 

If there are NULL values in Attribute A or Attribute B, in either Feature Stream 1, or Feature Stream 2, then will also need to insert additional AttributeFilters before the FeatureJoiners to filter off Features that have NULL values for the Attribute Join being tested, as FeatureJoiner will Reject Features with NULL values in the Join Attributes.

capture

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • August 28, 2020

Hi @aron​ 

Did you try to use the transformer Tester?

There is the conditions that you can configure.

 

Thanks in Advance,

Danilo


davtorgh
Contributor
Forum|alt.badge.img+12
  • Contributor
  • August 28, 2020

Hi aron,

 

you could send the two datasources to an InlineQuerier ad use an sql script to make the join (see attached workspace that generates two dataset with attributes A and B with random numbers and sends them to an InlineQuerier), but if the values are not unique (as it probably happens in the attached workspace), you get a cartesian product. Maybe it is not what you want.

 

Hope that helps!


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • Best Answer
  • August 28, 2020

If it is only 2 conditions to test, fastest performing workspace would probably be one that makes use of FeatureJoiners which do attribute indexing and bulk mode processing, although the InlineQuerier based solutions I've also found usually reasonably quick.

 

FeatureJoiner Solution like so. Note, it is important that the last FeatureJoiner is a FULL Outer join by setting the Join Mode.

 

If there are NULL values in Attribute A or Attribute B, in either Feature Stream 1, or Feature Stream 2, then will also need to insert additional AttributeFilters before the FeatureJoiners to filter off Features that have NULL values for the Attribute Join being tested, as FeatureJoiner will Reject Features with NULL values in the Join Attributes.

capture