-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathHelperFunctions.pq
18 lines (16 loc) · 989 Bytes
/
HelperFunctions.pq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
VSSampleTable = ( OutputTable as table) as text =>
let
TableToTransform = Table.FirstN(OutputTable,2),
Headers = Text.Combine(List.Transform(Table.ColumnNames(TableToTransform), each """"""&Text.From(_)&""""""), ","),
Data = Text.Combine(List.Transform(List.Transform(Table.ToRows(TableToTransform), each Text.Combine(List.Transform(_, (_)=> """"""&Text.From(_)&""""""), ",")), each "{"&_&"}"), ","),
TableFormat = "#table({"&Headers&"},{"&Data&"})"
in
TableFormat;
PQSampleTable = ( OutputTable as table) as text =>
let
TableToTransform = Table.FirstN(OutputTable,2),
Headers = Text.Combine(List.Transform(Table.ColumnNames(TableToTransform), each """"&Text.From(_)&""""), ","),
Data = Text.Combine(List.Transform(List.Transform(Table.ToRows(TableToTransform), each Text.Combine(List.Transform(_, (_)=> """"&Text.From(_)&""""), ",")), each "{"&_&"}"), ","),
TableFormat = "#table({"&Headers&"},{"&Data&"})"
in
TableFormat;