Google表格查询重复的第一行+结果错误

问题描述

我创建了一个通过函数绑定到Google表单的Google表单,我创建了一个2°标签以用QUERY过滤结果 您可以在这里查看结果

https://docs.google.com/spreadsheets/d/1nseIV5ieqsifOKwWvx7crbcTxxMZ3RKpb1kNUsoMt44/edit?usp=sharing

在“ Ricerca”选项卡中,可以在“ Risultati”选项卡中过滤行。您可以看到QUERY

=QUERY(Revisioni!A3:AI; "select * where (F contains '"&F2&"') and (E contains '"&H2&"') and
((Month(N)+1 = "&B2&" and year(N) = "&D2&" and O=false) or 
(Month(P)+1 = "&B2&" and year(P) = "&D2&" and Q=false) or 
(Month(R)+1 = "&B2&" and year(R) = "&D2&" and S=false) or 
(Month(T)+1 = "&B2&" and year(T) = "&D2&" and U=false) or 
(Month(V)+1 = "&B2&" and year(V) = "&D2&" and W=false) or 
(Month(X)+1 = "&B2&" and year(X) = "&D2&" and Y=false) or 
(Month(Z)+1 = "&B2&" and year(Z) = "&D2&" and AA=false) or 
(Month(AB)+1 = "&B2&" and year(AB) = "&D2&" and AC=false) or 
(Month(AD)+1 = "&B2&" and year(AD) = "&D2&" and AE=false) or 
(Month(AF)+1 = "&B2&" and year(AF) = "&D2&" and AG=false))")

在Ricerca!A5细胞中。

您可以看到结果类似

enter image description here

它将1°行+ 1°resut行合并

enter image description here

如何获得正确的结果?

解决方法

说明:

您应该添加一个0作为QUERY的最后一个参数。

根据documentation

标题-[可选]-数据顶部的标题行数。 如果省略或设置为-1,则根据以下内容猜测值 数据。

因此,它假设源数据中的第三行( A3 )是标题,这就是为什么将其添加到QUERY的输出中的原因。


解决方案:

=QUERY(Revisioni!A3:AI; "select * where (F contains '"&F2&"') and (E contains '"&H2&"') and
((Month(N)+1 = "&B2&" and year(N) = "&D2&" and O=false) or 
(Month(P)+1 = "&B2&" and year(P) = "&D2&" and Q=false) or 
(Month(R)+1 = "&B2&" and year(R) = "&D2&" and S=false) or 
(Month(T)+1 = "&B2&" and year(T) = "&D2&" and U=false) or 
(Month(V)+1 = "&B2&" and year(V) = "&D2&" and W=false) or 
(Month(X)+1 = "&B2&" and year(X) = "&D2&" and Y=false) or 
(Month(Z)+1 = "&B2&" and year(Z) = "&D2&" and AA=false) or 
(Month(AB)+1 = "&B2&" and year(AB) = "&D2&" and AC=false) or 
(Month(AD)+1 = "&B2&" and year(AD) = "&D2&" and AE=false) or 
(Month(AF)+1 = "&B2&" and year(AF) = "&D2&" and AG=false))";0)

参考:

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...