Google表格查询功能中是否有窗口功能?
动机:
我目前正在根据此公式建立数据库
=QUERY('DB'!A2:J,"select C, E, F, sum (J), count(J) where G = 'Gross Enterprise Subscription' group by C, E, F order by SUM(J) desc label C 'Owner', E 'Country', F 'Region', sum(J) 'Delta ES Increase', count(J) 'Num Enterprises in portfolio'",1)
但是我希望我可以添加一个类似于“ countifs”的函数来计数(J),在其中我要放置一个子句“ where J> 0”,这样我就可以同时拥有“ Num Enterprises in Portfolio”,即count(j)和``数量大于0的投资组合中的企业数量''为count(j> 0)。
尝试:
=ARRAYFORMULA(QUERY({'DB'!A2:J, IF('DB'!J2:J > 0, 1, )},
"select Col3,Col5,Col6,sum(Col10),count(Col10),count(Col11)
where Col7 = 'Gross Enterprise Subscription'
group by Col3,Col5,Col6
order by sum(Col10) desc
label Col3'Owner',
Col5'Country',
Col6'Region',
sum(Col10)'Delta ES Increase',
count(Col10)'Num Enterprises in portfolio',
count(Col11)'Num Enterprises in portfolio > 0'", 1))
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句