Skip to main content

Hello all, I frequently used the FeatureMerger or FeatureJoiner transformers. However, none of them seem to offer a join based on an expression, such as checking if a value from one table contains a value from another table. How can this be achieved? Thanks for any assistance.

Hi @marcyeranos​ ,

 

You should be able to accomplish this by creating a new attribute (temporary join key) with Conditional Values. Using this approach, you will use an AttributeManager to first create a new attribute, then using Conditional values, define the expression based on any available attributes that you wish to join on.

 

image 

If you need to reference attribute values from the other table, you'll either need to merge all of the attributes so they are accessible while creating the conditional value statements, or you could simply use multiple FeatureJoiners as the "unjoined" ports would indicate no matching features exist for the current "join on" statement. In this case, you could connect both unjoined output ports to another FeatureJoiner with the next statement you wish to join on.


Hi @chrisatsafe​ ​, Thank you for solution. Here's what I did guided by you: I assigned a unique key attribute to each table, setting id = 1 for instance. Then, I employed the "Full" option in the feature join, followed by the application of a tester transformer. In this tester, I set up a condition to check if the column value from one table is present in the column of the second table. And that did the trick! Much appreciated!


Hi @chrisatsafe​ ​, Thank you for solution. Here's what I did guided by you: I assigned a unique key attribute to each table, setting id = 1 for instance. Then, I employed the "Full" option in the feature join, followed by the application of a tester transformer. In this tester, I set up a condition to check if the column value from one table is present in the column of the second table. And that did the trick! Much appreciated!

Is it possible share your Workspace template to test..?

 

Having similar kind of approach

 

Thanks


Is it possible share your Workspace template to test..?

 

Having similar kind of approach

 

Thanks

Check Out the Custom Transformer I've Shared on the FME Hub! It's open to use. image


Reply