使用ImportJSON自定义函数检索数据子集

时间:2016-04-15 22:26:16

标签: json google-apps-script google-sheets custom-function

我使用Trevor Lohrbeer importjson() custom function将一些数据从this JSON source导入到Google表格中。

我不想要所提供的所有信息;我特别只想要列E,V,W,X,AA,AB,AC,AD。

在我意识到我不知道我对这个参数做了什么之前,我尝试了一些事情:

=importjson("http://www.pgatour.com/data/r/stats/current/102.json","This","AndThis")

如何修改此功能以仅检索上述项目?

1 个答案:

答案 0 :(得分:2)

您可以使用QUERY function轻松完成此操作,对importjson()来电的结果进行过滤后。:

=QUERY(importjson("http://www.pgatour.com/data/r/stats/current/102.json"),"select Col5, Col22, Col23, Col24, Col27, Col28, Col29, Col30")