[英]JSON Query in Power BI only returning first 1000 rows, how to return all rows
我一直在搜索互聯網不會成功。
我正在嘗試檢索所有行(62k+ 行),但調用只返回前 1000
有誰知道需要設置以增加 1000 限制的參數,或者如何重復調用直到返回所有行
Power Query 編輯器顯示以下內容
總計結果 62027
開始索引 1
itemsPerPage 1000
從高級編輯器查詢
讓
Source = Json.Document(Web.Contents("刪除 web 地址"))
在
資源
我只是碰巧遇到了同樣的問題。 以下代碼也應該適用於您。
我做了一個 function 來訪問 API:
let API = (relPath as text, optional queries as nullable record) =>
let
Source = Json.Document(Web.Contents("https://api.com/",
[ Query = queries,
RelativePath=relPath]))
in
Source
in
API
然后,我可以使用List.Generate
在另一個查詢中檢索記錄,以根據需要對 API 執行多次調用。
let
Source = API("path/to/records", [rows_per_page="1000"]),
pages = Source[total_pages],
records =
if pages = 1 then Source[records]
else List.Combine(List.Generate(
() => [page = 1, records = Source[records]],
each [page] <= pages,
(x) => [page = x[page] + 1, records = API("path/to/records", [page = Text.From(x[page] + 1), rows_per_page = "1000"])[records]],
each [records]))
in
records
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.