## Group and sum delimited values 2

NurlanPPF
Posts: 9
Joined: Tue Oct 23, 2018 10:15 pm

### Group and sum delimited values 2

Hello!

This expression

{L_CODE}{L_COLON} {L_SELECT_ALL_CODE}

`= Table.Group(Source, "ColumnA", {"new", each Text.Combine(List.Transform(List.Zip(List.Transform([ColumnB], each List.Transform(Text.Split(_, ";"), each Number.From(_)))), each Text.From(List.Sum(_))), ";")})`

groups and adds numbers in the list of only one column.
pic1.png (30.15 KiB) Viewed 521 times

How to change this expression to sum lists of several columns?
pic2.png (43.92 KiB) Viewed 521 times

Regards,
Nurlan

Rudi
Posts: 14
Joined: Fri Sep 01, 2017 4:33 pm

### Re: Group and sum delimited values 2

Like this:

{L_CODE}{L_COLON} {L_SELECT_ALL_CODE}

`let    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],    Data = Table.Group(Source, {"ColumnA"},     {        {"new", each Text.Combine(List.Transform(List.Zip(List.Transform([ColumnB], each List.Transform(Text.Split(_, ";"), each Number.From(_)))), each Text.From(List.Sum(_))), ";")},         {"new2", each Text.Combine(List.Transform(List.Zip(List.Transform([ColumnC], each List.Transform(Text.Split(_, ";"), each Number.From(_)))), each Text.From(List.Sum(_))), ";")},        {"new3", each Text.Combine(List.Transform(List.Zip(List.Transform([ColumnD], each List.Transform(Text.Split(_, ";"), each Number.From(_)))), each Text.From(List.Sum(_))), ";")}    })in    Data`