Skip to main content
Solved

Any way to do a non-equality join condition in FeatureMerger?

  • April 26, 2019
  • 3 replies
  • 101 views

tfcw
Contributor
Forum|alt.badge.img+1
  • Contributor
  • 13 replies

I'm working with two sets of data with nearly identical, but not quite matching, IDs. Ideally I'd like to join together rows where:

|requester_id - supplier_id| < 0.1

Is there any way within FME to accomplish this? Only way I can think of is to do a cartesian join and filter the results, but for this data the cartesian join would result in billions of rows and I'd like to avoid that.

Best answer by takashi

The InlineQuerier might help you.

SQL Query Example:

select r.*, s.*
from requestor as r
inner join supplier as s
on abs(r.requestor_id - s.supplier_id) < 0.1

0684Q00000ArKDBQA3.png

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

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 26, 2019

How about: Multiply both Id's by 10 and round them.

Store those multiplied ID's in a new attribute.

Then do the join on the new attribute and test on the above clause, using the original ID's.


tfcw
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • 13 replies
  • April 26, 2019

How about: Multiply both Id's by 10 and round them.

Store those multiplied ID's in a new attribute.

Then do the join on the new attribute and test on the above clause, using the original ID's.

Nope, doesn't work for what I'm looking for. Let's say:

 

 

requester_id = 10.51

 

supplier_id = 10.60

They should match but with that method they'd resolve to 105 and 106. I've tried messing around with rounding the values and I don't think it's something that can work. Let's say

 

 

requester_id1 = 10.41

 

requester_id2 = 10.59

 

supplier_id = 10.50

 

 

I'd want both requesters to match the supplier but I can't see how I'd make that happen through rounding.

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • April 26, 2019

The InlineQuerier might help you.

SQL Query Example:

select r.*, s.*
from requestor as r
inner join supplier as s
on abs(r.requestor_id - s.supplier_id) < 0.1

0684Q00000ArKDBQA3.png