Forum Discussion
ChemEnger
Advocate V
2 years agoCreate table from columns, defined from SelectRows
I have a table of Results by Analyst and would like to run an ANOVA in Excel. I am using Power Query to split the data into separate columns by Analyst: let
Source = Table.FromRows(Json.Docume...
- 2 years ago
How about doing without the function and using Group By in the Transform tab instead, grouping on the Analyst column:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jZNLDoMwDESvUrGuEAkUnGXLroBUUcQGcf9rVCKfeoITscvTOHE8treteE/FvVCmpGK/O9JVWadImdS51IyoRE0dNH15roN0BYpJxZ00c/GNc1w/jVayZa2DpQ6IMtRCgkagkMJIGQN2DOPP2ZTP/i8JZ/fg+OHJZSJBey2WHkC1QMKUhHue0EAFVF+mRrB6HW52qFDU8FEFxDU/jE5j/SLoJbkSPBmBsFg0Qp6InIbUZu7hKnTCK/4vrbCUclMUNxfL430m2GyDZqLtYDqdFGluCKyMCefNFjov/I8Hua2YoflCXMiNFJYuwiaL+eBIBTOiFZPm2PdWJycyF2nwvP8A", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Analyst = _t, Result = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Result", type number}}), GroupedRows = Table.Group(#"Changed Type", {"Analyst"}, {{"grp", each _[Result]}})[grp], Headers = List.Transform({1..List.Count(GroupedRows)}, each Number.ToText(_, "Analyst 0")), Finish = Table.FromColumns(GroupedRows, Headers) in FinishThe GroupedRows step returns only the [grp] column of the grouped tables, which makes it a list.
HotChilli
Community Champion
2 years agoYou've got a method that works, it's orderly, it's commented (a little excessively but that may be a personal thing), it can be maintained, it seems to be performant ... and you want to do what?