Group / Sort 2 Lists by same Value

Hi there,

I’ve been thinking about my problem for half the day, but unfortunately I can’t find a solution.

In the project, the elements are assigned different ObjectType_IDs (parameter values) (OBJ_FB_…).
Now I would like to know which model categories occur with each ObjectType_ID. An ObjectType_ID can occur in several model categories
I want to create a list where the model categories are grouped under my ObjectType_ID.
(see the codeblock)

Basically I have to throw out all sub-lists that are duplicates and merge the ones that have the same ObjectType_ID.

Thanks for any ideas and your help!

Some steps:

  1. List.GroupByKey where the list is your category names, and the key is your parameter values.
  2. Then List.UniqueItems set to @L2 for the input, to clear out any duplicate category names in the sublists.
  3. Then List.AddITemToFront to insert the key from the GroupByKey node at the front of each sublist.

Where you go from there I am not sure, but it should give you a setup like the code block.

2 Likes

Thanks guys, you are the best!

I was trying a lot with those nodes, but coudnt get it in the right order :smiley:

You saved my day :slight_smile: