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 func = | |
(Table as table, optional Step as number, optional SelectedColumns, optional GroupByColumns, optional Suffix as text, optional Buffer as any) => | |
let | |
// Steps to prepare the (optional) parameters for the nested function "fnFetchNextRow" | |
Source = if Buffer = null then Table else Table.Buffer(Table), | |
Step0 = if Step = null then -1 else Step, | |
Step_ = if Step = null then 1 else Number.Abs(Step), | |
Suffix = if Suffix = null then ".Prev" else Suffix, | |
GroupByColumns = if GroupByColumns = null then null else GroupByColumns, |
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 func = | |
(YList as list, NoOfIntervalls as number) => | |
let | |
Source = Table.FromColumns({YList}), | |
xAxis = Table.AddIndexColumn(Source, "Index", 1, 1), | |
Rename1 = Table.RenameColumns(xAxis,{{"Column1", "y"}, {"Index", "x"}}), | |
AvgX = List.Average(Rename1[x]), | |
AvgY = List.Average(Rename1[y]), | |
x = Table.AddColumn(Rename1, "xX", each [x]-List.Average(Rename1[x])), | |
y = Table.AddColumn(x, "yY", each [y]-List.Average(x[y])), |
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 | |
func = (Table as table, SortColumn as text, AmountColumn as text) => | |
let | |
/* Debug parameters | |
Table = #"Price Paid", | |
SortColumn = "Date", | |
AmountColumn = "Price paid", | |
*/ |
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 func = | |
(InputText as text, StartDelimiter as text, EndDelimiter as text, optional Alternative_Dummy as text) => | |
let | |
// If the end delimiter contains the same characters than the start delimiter then that portion has to be replaced in the end parameter by a dummy. Otherwise the query fails. | |
AlternativeDummy = Alternative_Dummy, | |
Dummy = if AlternativeDummy is null then "*+*" else AlternativeDummy, | |
String = InputText, | |
ParaStart = StartDelimiter, | |
ParaEnd = EndDelimiter, |
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 func = | |
(string as text, separator as any) => | |
let | |
/* Debug parameters | |
string = "Do I need gloves for Power Query?", | |
separator = {"s", "need ", "Do ", "?", "g", "for "}, | |
*/ |
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 func = | |
(SourceTable as table, GroupColumnNames as list, optional AggregationFunction as function, optional Type as type) => | |
let | |
/* Debug parameters | |
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIGYkMDIGFqoBSrgxAzAomZQcScgEwXIDYGiZkjxFyB2AQkZgEUiwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [GroupColA = _t, GroupColB = _t, SumCol1 = _t, SumCol2 = _t]), | |
SourceTable = Table.TransformColumnTypes(Source,{{"GroupColA", type text}, {"GroupColB", type text}, {"SumCol1", Int64.Type}, {"SumCol2", Int64.Type}}), | |
GroupColumns = {"GroupColA", "GroupColB"}, | |
*/ | |
MyType = if Type = null then type number else Type, |
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 func = | |
(SOURCE as table, PATH as text, optional mode as text, optional index as logical, optional header as logical, optional quoting as text, optional chunksize as number, optional decimal_as_point as text) => | |
let | |
Source = Table.TransformColumnTypes(SOURCE, List.Transform(Table.ColumnNames(SOURCE), each {_, type text})), | |
Path = PATH, | |
index = if index = null then "None" else "True", | |
header = if header = null then "True" else "False", | |
quoting = if quoting = null then "csv.QUOTE_ALL" else quoting, | |
chunksize = if chunksize = null then "None" else chunksize, |
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 func = | |
(optional StartDate as date) => | |
let | |
Query = QuickBooks.Tables(){[Key="entity"]}[Data], | |
DateString = Text.From(Date.Year(StartDate)) & "-" & Text.PadStart(Text.From(Date.Month(StartDate)),2,"0") & "-" & Text.PadStart(Text.From(Date.Day(StartDate)),2,"0"), | |
Source = if StartDate = null then Query("select * from TimeActivity") else Query("select * from TimeActivity where TxnDate > '" & DateString & "'") , | |
#"Expanded Column1" = Table.ExpandRecordColumn(Source, "Column1", {"TxnDate", "NameOf", "EmployeeRef", "CustomerRef", "ItemRef", "BillableStatus", "Taxable", "HourlyRate", "BreakHours", "BreakMinutes", "StartTime", "EndTime", "domain", "sparse", "Id", "SyncToken", "MetaData", "Description", "Hours", "Minutes"}, {"TxnDate", "NameOf", "EmployeeRef", "CustomerRef", "ItemRef", "BillableStatus", "Taxable", "HourlyRate", "BreakHours", "BreakMinutes", "StartTime", "EndTime", "domain", "sparse", "Id", "SyncToken", "MetaData", "Description", "Hours", "Minutes"}), | |
#"Changed Type1" = Tab |
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 func = | |
(Description as text, FunctionName as text, Content as text, AccessToken as text, optional public as any) => | |
let | |
Public = if public = null then false else true, | |
GitRecord = [description=Description, public=Public, files=Record.FromTable(#table({"Name", "Value"}, {{FunctionName, [content=Content]}}))], | |
URL = "https://api.github.com/gists?access_token=" & AccessToken, | |
BinaryJson = Json.FromValue(GitRecord), |