Google sheets Google查询语言:使用WHERE子句筛选数据透视表

Google sheets Google查询语言:使用WHERE子句筛选数据透视表,google-sheets,google-sheets-formula,google-sheets-query,Google Sheets,Google Sheets Formula,Google Sheets Query,在Google查询语言中,是否可以将WHERE子句与PIVOT子句结合使用 我使用以下查询从一个透视表开始: select B, sum(C) group by B pivot A select B, sum(C) group by B pivot A where A>=2018 现在我想修改透视表,以便只显示2018年及其后的列。我尝试了以下查询: select B, sum(C) group by B pivot A select B, sum(C) group by B pi

在Google查询语言中,是否可以将
WHERE
子句与
PIVOT
子句结合使用

我使用以下查询从一个透视表开始:

select B, sum(C) group by B pivot A
select B, sum(C) group by B pivot A where A>=2018

现在我想修改透视表,以便只显示2018年及其后的列。我尝试了以下查询:

select B, sum(C) group by B pivot A
select B, sum(C) group by B pivot A where A>=2018
为什么我会在这里出错?有没有办法实现根据特定条件筛选数据透视表的目标


您需要替换
where
子句

请使用以下公式:

=QUERY(A3:C9,"select B, sum(C) where A>=2018 group by B pivot A")
会议顺序如下: 选择、其中、分组依据、轴心、订单依据、限制、偏移、标签、格式、选项