itsnotaboutthecell

Power Query M - Oz Solution

Sep 20th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. let
  2. Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
  3. #"Changed Type" = Table.TransformColumnTypes(Source,{{"NOUN", type text}}),
  4. #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "NOUN", "Word To List"),
  5. #"Lowercased Text" = Table.TransformColumns(#"Duplicated Column",{{"Word To List", Text.Lower, type text}}),
  6. #"Split Column by Position" = Table.ExpandListColumn(Table.TransformColumns(#"Lowercased Text", {{"Word To List", Splitter.SplitTextByRepeatedLengths(1), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Word To List"),
  7. #"Added Custom" = Table.AddColumn(#"Split Column by Position", "Value", each Character.ToNumber([Word To List]) - 96),
  8. #"Grouped Rows" = Table.Group(#"Added Custom", {"NOUN"}, {{"Word Value", each List.Sum([Value]), type number}})
  9. in
  10. #"Grouped Rows"
Advertisement
Add Comment
Please, Sign In to add comment