Sum list values

I have a list and I want to sum the nested list values … into a new list.
Should be easy peasy, but can’t figure it out … math.sum isn’t working for me.

Since list has sometimes ‘empty’ nested lists, I thought of perhaps replacing empty with value “0” but still, no decent sum results…

How?

(result should be:
List

  • 0 List
    – 1.6215
  • 1 List
    – 0.63811
  • 2 List
    – 1.24226
  • 3 List
    – 0

etc.

You just need to flatten those sublists first.

Hi,

I kind of have a similar issue, not with an empty list, but with null values. To address this, I flattened my original list from level 4 to level 2. Than using the ‘List.ReplaceNull’ node, the null values were replaced with zeros. However, I’ve now lost the original hierarchy. My lists were initially grouped by a key (Revit parameter). Is there any way to restore the original list logic?

Try not to revive 6 year old threads. Best to start a new topic with an image and explanation of what you have and what you’re wanting.

Thanks!

Thank you, I will!