List group by value


#1

Hi everyone and happy new year !

I’m trying to do some sorting with a list and I can’t figure the right way to do it.
Let me explain the problem :

I have a list like this :

[0]List
[0] A
[1] V

[1] List
[0] A
[1] W

[2] List
[0] B
[1] X

[3] List
[0] B
[1] Y

[4] List
[0] B
[1] Z

And this list can go long and long but my point is :
I would like to make list depending on the “common” number that i found in [0] (and as i say, with unknown value or number of the value in [0] - depending of the project)
[0] List
[0]V
[1]W

[0] List
[0]X
[1]Y
[2]Z

Hope someone has the answer ^^

 


#2

Will the item you need always be index [1]-[2]?


#3


#4

Thank you, I’ll try this right away.

@John : Yes, the value i need is always in [1]

@Vikram : Is the “Groupbyfunction” Node is directly in Dynamo or in a package ?


#5

No package, it’s in Dynamo 0.9.1 and 1.0


#6

Here’s what i get.
After the second List.map it’s begin to look like what i’m searching for but the flatten didn’t seems to work as yours.

Not sure what i’m missing there…

 


#7

Flatten seems to work as expected in 0.8.2 too.

Not sure what the problem is.

 


#8

If you are in Manual, maybe you didn’t Run after adding/altering the Flatten node :slight_smile:

 


#9

Thanks !