Skip to content

Instantly share code, notes, and snippets.

@jaykilleen
Created May 10, 2016 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaykilleen/6e917474a7cb2978ed94feba075fe0e7 to your computer and use it in GitHub Desktop.
Save jaykilleen/6e917474a7cb2978ed94feba075fe0e7 to your computer and use it in GitHub Desktop.
(Haystack as text, Needle as text) as number =>
List.Count(Text.Split(Haystack, Needle)) - 1
(Rec as record, Lambda as function) as record =>
let
Keys = Record.FieldNames(Rec),
Values = Record.FieldValues(Rec),
Renamed = List.Transform(Keys, each Lambda(_, Record.Field(Rec, _))),
Recorded = Record.FromList(Values, Renamed),
Return = Recorded
in
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment