9 lines
700 B
Plaintext
9 lines
700 B
Plaintext
let
|
|
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
|
|
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
|
|
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Category", "Name", "Total", "Tax", "Discount"}))),
|
|
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Tax", Currency.Type}, {"Discount", Currency.Type}, {"Date", type date}}),
|
|
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}, {"Category", Order.Ascending}})
|
|
in
|
|
#"Sorted Rows"
|