Google表格查询删除标头不与偏移量一起使用 [英] Google sheets query to remove header not working with offset

查看:70
本文介绍了Google表格查询删除标头不与偏移量一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法弄清楚为什么其中一些查询有效而另一些无效.只是试图建立自己的表

Can't figure out why some of these queries work and some don't. Just trying to build a table of my own

=query(TRANSPOSE(ImportHtml(C7, "table",1)),"select * limit 1 offset 1")

=query(TRANSPOSE(ImportHtml(C2, "table",1)),"select * limit 1 offset 1")

c2 = http://www.vitalmtb.com/product/compare/2819C7 = http://www.vitalmtb.com/product/compare/2775

当我想删除标题并保留数据时,那些不起作用的标题会带回标题行.

The ones not working bring back the row of headers, when I want to remove the headers and leave the data.

推荐答案

query公式具有第三个可选参数:标头行数.如果未提供,则会猜测哪些行是标题(通常是最上面的行).在您的第一个示例中,它的猜测是有1个标题行.

The query formula has the third, optional parameter: the number of header rows. If it's not provided, a guess is made to what rows are headers (usually the top one is). In your first example, its guess is that there is 1 header row.

标题行始终是query返回的数组的一部分,它使用它来标记返回的列(除非您通过为label提供不同的标题来覆盖它).这就是为什么您无法通过更改偏移量来摆脱它:偏移量决定了要返回的 data 行;标题行始终存在.

The header row is always a part of the array returned by query, which uses it to label the returned columns (unless you override that by providing different headers with label). This is why you can't get rid of it by changing offset: the offset determines with data rows to return; the header row is present regardless.

要摆脱标题,请将第三个参数设置为0,以便将标题视为数据.然后offset将偏移它们:

It you want to get rid of headers, set the third parameter to 0, so that the headers are treated as data. Then offset will offset past them:

=query(TRANSPOSE(ImportHtml(C2, "table", 1)), "select * limit 1 offset 1", 0)

这篇关于Google表格查询删除标头不与偏移量一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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