Forum Discussion
Group Based on Column Name
- 1 year ago
Hello
thanks for your suggestions.
Finally, I found this solution:
Header = Table.ColumnNames (#"Removed Columns2"),
SelectDollarColumns = List.Select(Table.ColumnNames(#"Removed Columns2"), each Text.Contains(_, "$")),
HeadersToRemove = List.Combine ({{"PHASE IN TOTAL MATURE VOLUMES"},SelectDollarColumns}),
HeaderDifference = List.Difference (Header,HeadersToRemove),Grouped_Table = Table.Group (
#"Removed Columns2",
HeaderDifference,
List.Transform(
SelectDollarColumns,
(l)=> {l, each List.Sum(Table.Column(_, l)), type nullable number}
)
)
Hi Mic1979 , I have made some changes as per what I understood from your query. Do let me know if I have solved your query. Thanks!
https://docs.google.com/spreadsheets/d/1u3tdus_7axiZPNVX8WZWS8R6X_karx_G/edit?usp=sharing&ouid=104752674875039603034&rtpof=true&sd=true
Thanks for your suggestion, but this is not what I was looking for.
I wanted to have:
#"Grouped Rows" = Table.Group(
Source,
HeaderDifference,
{something here to sum all the columns with $ in the column name}
Hoping this clarifies.
Thanks.
- SundarRaj1 year agoSuper User
Right Mic1979 , that clearly underlines the query. I might have misunderstood it earlier. Have a look at this one. Thanks!
https://docs.google.com/spreadsheets/d/1qEjIgfc7pLXfUU8vfT_oChhXlag0Z2-d/edit?usp=sharing&ouid=104752674875039603034&rtpof=true&sd=true