條件查詢與群體聚合(query)
data_query對一個母體下條件篩出一組標的,並對整組計算聚合統計(count/coverage/min/max/mean/median/sum),如「費用率 0.4% 以下的被動 ETF,其費用率中位數」。where 語法為「欄位 運算子 值」以 and 連接(例 fee<=0.4 and type=passive)。回應必附母體大小 population 與欄位覆蓋率 coverage(有幾檔真的有這個欄位)。注意:績效欄位可用於 where 篩選與聚合統計,但不得作為排序鍵——排序即排名,本站不對個別商品做推薦。Filter a universe and aggregate over the matched set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | 排序鍵,只接受中性鍵 code/name/holders(規模/人氣),不接受績效欄位 | |
| limit | No | sample 回列數,預設 10、上限 20 | |
| where | No | 條件式,如 fee<=0.4 and type=passive;省略=全母體 | |
| universe | Yes | 母體,如 etf.tw(見 data_catalog) | |
| aggregate | No | 聚合,如 median:fee,count(逗號分隔、最多 4 個) |