【问题标题】:Count text using Query with ImportRange使用带有 ImportRange 的 Query 计算文本
【发布时间】:2020-04-13 22:15:38
【问题描述】:

我正在尝试使用带有 Importrange 的 Query 创建一个表,以计算特定雇主发生的特定事件的次数。数据表有超过 500 行,但这是数据示例:

Sample Data

我希望查询在另一个工作表中但在同一个电子表格中产生以下数据:

这是我的公式

=QUERY(IMPORTRANGE("1-f6OU8ylDSlpqdpt4P5B7GDcIel3IboVkUbY2huMA6U", "Events/Incidents!A2:Y"),"select Col3, Col5 where Col9='Accident' Count(Col9) Group by Count(Col9) Order by Count(Col9) desc limit 20", 1)

我无法让查询计算列 I = 事故中的文本。非常感谢您的帮助。

【问题讨论】:

    标签: google-sheets


    【解决方案1】:

    我认为您的查询很接近。试试这个:

    =QUERY(IMPORTRANGE("1-f6OU8ylDSlpqdpt4P5B7GDcIel3IboVkUbY2huMA6U", "Events/Incidents!A2:Y"),"select Col3, Col5, Count(Col9) where Col9='Accident' Group by Col3, Col5 order by Count( Col9) desc 限制 20", 1)

    【讨论】:

      【解决方案2】:

      您的查询语法需要更改。

      请尝试以下方法:

      =QUERY(IMPORTRANGE("1-f6OU8ylDSlpqdpt4P5B7GDcIel3IboVkUbY2huMA6U", "Events/Incidents!A2:Y"),"select Col3, Col5, count(Col9) where Col9='Accident' group by Col3, Col5 Order by Count(Col9) desc limit 20", 1)
      

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多