Skip to main content

Hi there. Iam trying to do a workspace to combine values/attributes from two different lists/objects. Idea is that there is always 1 parent ”object” and 1-x child ”object(s)” under the parent ”object”. The software that i am using to make these objects gives a unique identifier number for the parent object, for example ABC1. Software also gives a unique identifier number for child object by using the parent identifier + adding a letter after that, for example ABC1_A, ABC1_B and so on.

 

The problem that i havent solved is how to combine and make new attributes by comparing parent and child object indentifiers. If the child object shares the main part (ABC1) of the identifier number it should have get the values from the parent and merge them with the child attributes/values. So, for example child objects ABC1_A, ABC1_B, ABC1_C, ABC1_D all gets attributes/values from parent object by shared parent id ABC1. New, combined attributes has values from parent objects and child objects.

 

I hope that you understand what iam trying to do here, English is not a native language for me. There is few pictures below to demonstrate what i try to achieve.

@mahtaja​  what you need to do is to create a new 'parent ID' attribute on your child tables. So you would drop the suffix ABC1_A, and have just ABC1. Then use that for the join.

If you are familiar with regular expressions then you can use StringSearcher:

transformerThe result will be in an attribute _parentID{0}.part = ABC1

There are many string manipulation transformers. SubstringExtractor mght work if length of the of the parentID is consistent.

Once you have created the parent ID, then use FeatureJoiner to merge the parent/child records.


@mahtaja​  what you need to do is to create a new 'parent ID' attribute on your child tables. So you would drop the suffix ABC1_A, and have just ABC1. Then use that for the join.

If you are familiar with regular expressions then you can use StringSearcher:

transformerThe result will be in an attribute _parentID{0}.part = ABC1

There are many string manipulation transformers. SubstringExtractor mght work if length of the of the parentID is consistent.

Once you have created the parent ID, then use FeatureJoiner to merge the parent/child records.

Thanks @Mark Stoakes​, i used the first method you suggested and it worked like a charm. Solution was much more simple than i thought it would be.


Reply