有没有一种方法可以过滤数据透视查询以删除空白列

时间:2019-07-06 16:22:12

标签: google-sheets transpose google-sheets-formula google-sheets-query google-query-language

我只想显示正,中性和负数列并消除空白列

我的查询:

={query(SMedia_Data!A1:P, "select L, count(K) where B= '"&$B1&"' and A=date '"&TEXT(C1,"yyyy-mm-dd")&"' group by L pivot H",1),query(SMedia_Data!A1:P, "select count(H) where B= '"&$B1&"' and A=date '"&TEXT(C1,"yyyy-mm-dd")&"' group by L label count(H) 'Total'")}

1 个答案:

答案 0 :(得分:0)

尝试这样:

=TRANSPOSE(QUERY(TRANSPOSE({
 QUERY(SMedia_Data!A1:P, 
 "select L,count(K) 
  where B='"&$B1&"' 
    and A=date '"&TEXT(C1, "yyyy-mm-dd")&"'
  group by L pivot H", 1), 
 QUERY(SMedia_Data!A1:P, 
 "select count(H) 
  where B='"&$B1&"' 
    and A=date '"&TEXT(C1,"yyyy-mm-dd")&"' 
  group by L 
  label count(H)'Total'", 0)}), 
 "where Col2 is not null", 0))