【问题标题】:using query with importRange() - "Unable to parse query string for Function QUERY parameter 2: NO_COLUMNF"使用带有 importRange() 的查询 - “无法解析函数 QUERY 参数 2 的查询字符串:NO_COLUMNF”
【发布时间】:2015-06-07 18:15:32
【问题描述】:

我尝试了很多排列并不断碰壁。为什么这不起作用。

第 1 步,这行得通:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/blablabla/edit#gid=blablabla","combined!A1:F10")

生产:

ga:year ga:month    ga:source   ga:medium   ga:campaign ga:goalCompletionsAll
2013    6   #3 Announcement of new titles   email   iPad title announcement 1
2013    6   (direct)    (none)  (not set)   3948
2013    6   0fb72887-fb60-4d86-b8e2-9990801bc83e    (not set)   wda 0
2013    6   1.1.1.1 referral    (not set)   0
2013    6   1.1.2.1 referral    (not set)   0
2013    6   10.122.101.1    referral    (not set)   0
2013    6   10.14.163.91:8080   referral    (not set)   0
2013    6   10.15.0.1   referral    (not set)   0
2013    6   10.173.0.1  referral    (not set)   0

到目前为止一切顺利。

我的实际数据集有数万条记录。我想最初在这个样本集上计数(*):

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/blablabla/edit#gid=blablabla","combined!A1:F10"),"SELECT COUNT(F)",1)

给予:

无法解析函数 QUERY 参数 2 的查询字符串: NO_COLUMNF

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/blablabla/edit#gid=blablabla","combined!A1:F10"),"SELECT COUNT(*)",1)

给予:

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROREncountered "*" at line 1, column 14. Was expecting one of: "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ... <ID> ... <QUOTED_ID> ...

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/blablabla/edit#gid=blablabla","combined!A1:F10"),"SELECT COUNT F",1)

给予:

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROREncountered "F" at line 1, column 14. Was expecting one of: <EOF> "where" ... "group" ... "pivot" ... "order" ... "skipping" ... "limit" ... "offset" ... "label" ... "format" ... "options" ... "," ... "*" ... "+" ... "-" ... "/" ... "%" ... "(" ...

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/blablabla/edit#gid=blablabla","combined!A1:F10"),"SELECT COUNT('ga:goalCompletionsAll')",1)

提供: 无法解析函数 QUERY 参数 2 的查询字符串:第 1 行第 14 列的 PARSE_ERROREncountered "\'ga:goalCompletionsAll\'"。期待以下之一:"min" ... "max" ... "avg" .. . “count” ... “sum” ... “no_values” ... “no_format” ... “is” ... “null” ... “year” ... “month” ... “天”...“小时”...“分钟”...“秒”...“毫秒”...“与”...“包含”...“开始”...“结束” ...“匹配”...“喜欢”...“现在”...“dateDiff”...“季度”...“下限”...“上限”...“dayOfWeek”... . "toDate" ... ... ...

我已经尝试了很多其他的东西。不断出错。

当我在有问题的工作表内并运行查询时,它可以工作。只有当我尝试导入时才会出现问题。但是如果你看一下我写的第一个函数,我可以导入数据。

什么给了?

【问题讨论】:

    标签: google-sheets


    【解决方案1】:

    如果你还没有让它工作,试试 Col6 而不是 F。当使用 importRange 查询时,它需要列号,其中 Col1 是导入范围中选择的第一列。

    【讨论】:

      【解决方案2】:

      尝试先在工作表上执行 Importrange,然后再创建另一个工作表以供查询。 这对我有帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-06-09
        • 2016-07-10
        相关资源
        最近更新 更多