Get Summation Of Numbers For Each Level

Hello everyone
I have a program that gives me the elements in each level (the pink part of image) and also gives me a number for each element (the blue part of image), I want to get the summation of these numbers for each level, Please help me to do that.
Thank you very much!

Could you possibly share more of your graph? I have a hunch that maybe this could be solved “earlier” in you script.

1 Like

thank you dear jostein,
my program is so huge and at the end i just want to do a simple work. i just want to get the summation of numbers that related to elements for each level.

Well, as some in here know… I’m fond of dictionaries.

1 Like

Thank you so much dear jostein
it works correctly in my program (but not with element.name component, it works with element.id component, because i have different values for elements that have the same name). now my problem is that i want to get the summation of numbers in each list, for example in the image that you sent i want to get the summation of numbers in list 0,1 etc.in other words i want to get the output of dictionary code block in separate lists like the output of groupbyfunction component or element.name component in your image.

Yeah… I just saw that my graph didn’t return the nested lists… A number of ways of doing it, but you can use the dictionary node from the spring package instead, works exactly the same but dynamo takes care of list levels.

1 Like

Thank you very very much dear jostein
it works perfect!