Last active
September 19, 2017 18:25
-
-
Save ImkeF/8e49f73d98b371ae978c210c16ad9bff to your computer and use it in GitHub Desktop.
M functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
// Fetches your function library from a csv-file: 3 columns "Column1" is autogenerated and will be removed, "GetCode" hold code and "Name" the name of the function | |
// Adjust "Path" to your own machine: | |
Path = "C:\Users\imkef\Desktop\ImkesFunctions.csv", | |
// The Encoding parameters might need to be adjusted to local settings | |
Source = Csv.Document(File.Contents(Path),[Delimiter=",", Columns=3, Encoding=1252, QuoteStyle=QuoteStyle.Csv]), | |
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}, {"Column3", type text}}), | |
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]), | |
#"Removed Columns" = Table.RemoveColumns(#"Promoted Headers",{"Column1"}), | |
EvaluateFunction = Table.AddColumn(#"Removed Columns", "Value", each Expression.Evaluate([GetCode], #shared)), | |
Cleanup = Table.RemoveColumns(EvaluateFunction,{"GetCode"}), | |
ToRecord = Record.FromTable(Cleanup) | |
in | |
ToRecord |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment