我只想显示正,中性和负数列并消除空白列
我的查询:
={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 :(得分: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))