|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
需要获取三个月来每天的各城市疫情数据,在网上看到excel的Power Query的获取方法,他的代码如下:let location =(province,city)=>Json.Document(Web.Contents("https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list?province="&Uri.EscapeDataString(province)&"&city="&Uri.EscapeDataString(city)))[data], Source = Excel.CurrentWorkbook{[Name="城市表"]}[Content], GetDataColumn=Table.AddColumn(Source, "data", each location([省份],[城市])), ExpandedData1 = Table.ExpandListColumn(GetDataColumn, "data"), ExpandedData2 = Table.ExpandRecordColumn(ExpandedData1,"data", {"date", "confirm", "dead", "heal", "confirm_add"}, {"日期", "累计确诊", "死亡", "治愈", "新增确诊"}), ChangedType = Table.TransformColumnTypes(ExpandedData2,{{"日期", type date}, {"省份", type text}, {"累计确诊", Int64.Type}, {"死亡", Int64.Type}, {"治愈", Int64.Type}, {"新增确诊", Int64.Type}}), FilteredRows = Table.SelectRows(ChangedType, let latest = List.Max(ChangedType[日期]) in each [日期] < latest) in FilteredRows
但是我按照步骤做时,却出现了这样的错误。
恳请各位大佬帮忙看看如何解决,因为是助研需要,在线等,超急的QAQ
非常感谢!!
|
|