Sum Nested Lists Values

Hi there,

I have a list, and I want to sum the values of the nested lists into a new list. However, Neither math.sum nor List.Reduce is working for me.

I have a varying number of Level @3 lists inside Level @4 lists

So, I just want to sum all P1’s/P2’s/P3’s and P4’s.

I have tried to flatten the original one, but then it came out with null values. Then, using the ‘List.ReplaceNull’ node, the null values were replaced with zeros. However, I’ve now lost the original list in which my values were grouped by a certain parameter.

Sum requires a list so you’ll have to flatten at the appropriate depth as you guessed, but you won’t be able to sum mixed values (numbers and strings). You need to clean out all the strings first.

2 Likes

I Will try that, thank you very much.