With these two lists I try to reconstruct the ‘desired output’.
What the final list is telling me is that i have 6 elements in a project, 3 elements on the first floorlevel and 3 elements on the 2nd floor. On the first floor there is a group of 1 and a group of 2 elements, on the second floor the same but in another order.
Thnx all for the answers, @SeanP to my knowledge I tried every combination of list level but it didn’t work.
The other solutions do not work in my case, because I need to work with the given information as an input i.e. I need to create the result with only the inputs given: List(1…6…1), list{3,3}, list{1,2,2,1}.
What i actually need for the List.Chop to do is to chop the list as if there where no sublists, but in the output I need the (sub)sublists again back.
Good solutions both, but I cannot recreate the given inputs automatically so it is useless if my input changes.
Thnx again for the answers, they work with the simple example, but not if I make it a little bit more difficult. Luckily I managed to solve it wihout using Python, because that is a bridge to far right now for me.
This is my solution:
Because it gives not the desired output. I need the first 3 elements (not groups) in one subsublist (this equals the first 2 groups), then the next 3 elements in one subsublist (equals 1 group) and finally 4 elements in one subsublist. This equals the last 4 groups.
The simple solution with only the list.chops puts the first 3 groups into one subsublist.
well i believe the purpose of doing this is the group elements together based on their type and property right. so using groupbykey are still the easiest way around.
The list is not grouped by type and property, but by distance so they do not share a key together.
Yes Nick, your graph helped a lot in my solution. But it didnt work out as you can see in the 2 List (here i am expecting the numbers 7 and 8 grouped under [0] List).