- let
- func = (page as any) =>
- let
- url="https://fx.cmbchina.com/api/y1/fx/history-rate/page",
- headers=[#"Content-Type"="application/json;charset=UTF-8"],
- query=[],
- content="{""nbr"":""港币"",
- ""startDate"":""2009-01-01"",
- ""endDate"":""2050-11-12"",
- ""pageSize"":""38"",
- ""pageNum"":"& Text.From(page) & "}",
- web=Text.FromBinary(web.Contents(url, [Headers=headers,Query=query,Content=Text.Tobinary (content)])),
- data = Table.FromRecords(Json.Document(web)[body][list]),
- 删除的列 = Table.RemoveColumns(data,{"ccyNbrEng","upTime"}),
- 重排序的列 = Table.ReorderColumns(删除的列,{"ratDat","rthBid","rtcBid","rtbBid","rthOfr","rtcofr"}),
- 删除的列1 = Table.RemoveColumns(重排序的列,{"rtbBid"}),
- 重命名的列 = Table.RenameColumns(删除的列1,{{"ratDat","日期"},{"rthBid","汇买价"},
- {"rtcBid","钞买价"},{"rthofr","汇卖价"},{"rtcofr","钞卖价"}})
- in
- 重命名的列 ,
- result = Table.Combine(List.Transform({1..10}, each func(_)))//提取1至10页
- in
- result
复制代码
帮我看这错误是哪里,谢谢
|