Skip to main content
Solved

How can I assign a value to a new field that matches in one field but then differ in the second field?

  • October 5, 2023
  • 3 replies
  • 23 views

kdwss
Contributor
Forum|alt.badge.img+3
  • Contributor
  • 3 replies

This seems easy but I'm not sure how to go about it. I want to do an initial match on ID1 and then detect if ID2 has different values. So A has different values in ID2, and B does not.

 

Initial data

imageRequired Data

image 

 

 

Best answer by dustin

Feed your features into an Aggregator, with Group By processing set to both ID1 and ID2. Send the resulting features to a Matcher with Group By set to ID1, which will give you the group of features where both ID1 and ID2 always match. This will be the Supplier in a FeatureMerger, with the original features being the Requestor, merging on ID1. From the Merged port assign the DIFFERS attribute as N, and from the UnmergedRequestor assign those DIFFERS as Y.

image

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

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 629 replies
  • Best Answer
  • October 5, 2023

Feed your features into an Aggregator, with Group By processing set to both ID1 and ID2. Send the resulting features to a Matcher with Group By set to ID1, which will give you the group of features where both ID1 and ID2 always match. This will be the Supplier in a FeatureMerger, with the original features being the Requestor, merging on ID1. From the Merged port assign the DIFFERS attribute as N, and from the UnmergedRequestor assign those DIFFERS as Y.

image


kdwss
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 3 replies
  • October 5, 2023

Feed your features into an Aggregator, with Group By processing set to both ID1 and ID2. Send the resulting features to a Matcher with Group By set to ID1, which will give you the group of features where both ID1 and ID2 always match. This will be the Supplier in a FeatureMerger, with the original features being the Requestor, merging on ID1. From the Merged port assign the DIFFERS attribute as N, and from the UnmergedRequestor assign those DIFFERS as Y.

image

Works brilliantly, thank you!


  • 2 replies
  • October 6, 2023

It is very easy to assign the same value to another new value even if it is different. Just select the column assign the same value to both and implement it.

 

Expert Mold Inspection Services in Tampa FL