如何使用Query ImportRange解决错误 [英] How to Resolve Error with Query ImportRange

查看:597
本文介绍了如何使用Query ImportRange解决错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有一个指向正确的方向。我绝对不是程序员,但我正在努力学习。 :)

  = QUERY(IMPORTRANGE(1ZKw8d7OKX_LqnYx_84IHP2fuBo-6rzzZ7TuaQOfCjio,Data!A2:D7),选择Col1, Col2,Col3,Col4 Col4!='Completed',0)

错误,指出:


错误



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


源表中有1-4列。列4包含状态项目,如完成,等待,新建,进度。



我做错了什么?无法想象出我的生活。
另外,一旦我有这个工作,是否有可能在脚本中做同样的事情,将它存储在一个数组中,然后通过电子邮件发送查询的数据?

解决方案

你有没有允许访问到导入范围功能?尝试将导入范围首先放入不同的单元格中(任何单元格都无关紧要)。如果你不允许访问,你会看到#REF。悬停/点击单元格,您将看到一个标题为允许访问的按钮。点击它,数据将会出现,你的查询应该可以正常工作。


hoping for a little pointer in the right direction. I'm definitely not a programmer but I'm trying to learn. :)

=QUERY(IMPORTRANGE("1ZKw8d7OKX_LqnYx_84IHP2fuBo-6rzzZ7TuaQOfCjio","Data!A2:D7"), "select Col1, Col2, Col3, Col4 where Col4 != 'Completed' ", 0)

I'm getting an error that states:

Error

Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Col2

There are columns 1-4 in the source sheet. Column 4 contains status items like Completed, Waiting, New, InProgress.

What am I doing wrong? Can't figure it out for the life of me. Also, once I have this working, is it possible to do the same thing in script, store it in an array, then email the queried data?

解决方案

Have you "Allowed Access" to the Importrange function? Try just putting the importrange first in a different cell (any cell it doesn't matter). If you haven't allowed access you will see #REF. Hover/click on the cell and you will get a popup with a button titled "Allow Access". click it, the data will appear and your query should work.

这篇关于如何使用Query ImportRange解决错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆