如何只从FILTER结果中获取某些列? [英] How to take only certain columns from a FILTER result?

查看:242
本文介绍了如何只从FILTER结果中获取某些列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 FILTER 从一个范围中提取行,并且只想获取某些列。例如,我按D筛选,但只需要以相反的顺序排列B,C。我尝试使用 QUERY


$ b

= QUERY(filter(B:D,D :无法分析QUERY参数2的查询字符串:NO_COLUMNC

:无法分析QUERY参数2的查询字符串:D> = 2),select C,B) = QUERY(filter(B:D,D:D> = 2),select *)
- 显示所有列,所以 QUERY 应该工作...



我如何 QUERY FILTER ?任何其他方式来实现这一点?

解决方案

当您正在查询计算数组时,您需要使用Colx符号而不是列(B:D,D:D> = 2),选择Col2,Col1) c $ c

偶然可以通过使用QUERY来实现:

= QUERY(B:D,select C,B where D> = 2)



或者只是FILTER:



= FILTER({C:C,B:B},D:D> = 2)


I'm using FILTER to extract rows from a range, and want to take only certain columns. For example, I filter by D, but want only columns B,C in reverse order. I tried to use QUERY:

=QUERY(filter(B:D,D:D>=2), "select C,B") - Error: can't analyze query string for function QUERY parameter 2: NO_COLUMNC
=QUERY(filter(B:D,D:D>=2), "select *") - shows me all columns, so QUERY should work...

How do I QUERY the results of FILTER? Any other way to achieve this?

解决方案

When you are QUERYing a computed array, you need to use the Colx notation rather than column letters:

=QUERY(FILTER(B:D,D:D>=2),"select Col2, Col1")

which incidentally can be achieved by just using the QUERY:

=QUERY(B:D,"select C, B where D >= 2")

or just FILTER:

=FILTER({C:C,B:B},D:D>=2)

这篇关于如何只从FILTER结果中获取某些列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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