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 = | |
(XML as table) => | |
let | |
Source = XML, | |
AddSort = Table.Buffer(Table.AddColumn(Source, "Sort", each 0)), | |
LG = List.Skip(List.Generate( ()=> | |
[Next = AddSort, Counter = 1, AddIndex= #table({"Sort"}, {{""}})], | |
each [AddIndex]{0}[Sort]<>"End", | |
each [ |
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, MyFunction as function) => | |
let | |
OldColumnNames = Table.ColumnNames(Table), | |
NewColumnNames = List.Transform(OldColumnNames, MyFunction), | |
RenameList = List.Zip({OldColumnNames, NewColumnNames}), | |
RenameColumns = Table.RenameColumns(Table, RenameList) | |
in | |
RenameColumns , | |
documentation = [ |
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 = (JSON) => | |
let | |
Source = JSON, | |
ParseJSON = try Json.Document(Source) otherwise Source, | |
TransformForTable = | |
if Value.Is(ParseJSON, type record) then | |
Record.ToTable(ParseJSON) | |
else | |
#table( |
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 = | |
(QueryText as text, optional HtmlAdress as text) => | |
let | |
/* Debug parameters | |
QueryText = "// Source: https://gist.githubusercontent.com/tonmcg/c5889375a84482f2d2862d620b6f191d/raw/e576da943b79b4690c9b81494365d1f59b075b37/List.Percentile.pq #(lf) // from NIST 7.2.6.2 Percentiles#(lf)// https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm#(lf)// Note that there are other ways of calculating percentiles in common use#(lf)// Hyndman and Fan (1996) in an American Statistician article evaluated nine different methods (R1 to R9)#(lf)// for computing percentiles relative to six desirable properties. #(lf)// Their goal was to advocate a ""standard"" definition for percentiles that would be implemented in statistical software. #(lf)// Although this has not in fact happened, most statistical and spreadsheet software use one of the methods described in Hyndman and Fan.#(lf)// The method used here is patterned after the R6, R7, and R8 methods; R7 is the default method used in Excel and R an |
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 SelectedType as type, optional ExcludeList as list) => | |
let | |
/* Debug Parameters | |
SelectedType = type table, | |
ExcludeList = null, | |
End of debug parameters */ | |
//By default, the query "GetAllQueries" will be excluded, so if you name this query so, you get everything BUT this query. |
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 SelectedType as type) => | |
let | |
/* Debug Parameters | |
SelectedType = type table, | |
End of debug parameters */ | |
Source = #shared, | |
ToTable = Record.ToTable(Source), |
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 = | |
(List as list) => | |
let | |
List = List.Buffer(List), | |
LA = | |
List.Accumulate( | |
List.Skip(List), | |
[Table = Table.FromColumns({List}), Counter = 2], |
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 = | |
(PeriodStartForecast as number, PeriodEndForecast as number, OriginalForecast as table) => | |
let | |
/* Debug Parameters | |
PeriodEndForecast = PeriodEndForecast, | |
PeriodStartForecast = PeriodStartForecast, | |
OriginalForecast = LU_Original_Forecast_Data, | |
*/ |
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 = | |
(Server as text, Database as text, SQLTable as text, SQLColumn as text, FilterList as list) => | |
let | |
/* Debug parameters | |
Server = "localhost", | |
Database = "postgres", | |
SQLTable = "public.mytesttable", | |
SQLColumn = "Col1", | |
FilterList = Filter[Column1], |