[英]I want to use this query as an arrayformula
Can anyone suggest to me how I can convert this query into something that will work in an arrayformula?任何人都可以向我建议如何将此查询转换为可以在数组公式中使用的内容?
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" label count(A) ''",1),0)
It's basically just counting to see how many orders I had in each month.基本上只是计算我每个月有多少订单。
Thanks for looking.谢谢你看。
Sheet: https://docs.google.com/spreadsheets/d/1Of6cdFYaOzCFwPdZ4ABItD6dghMjHhafRWmDJWaznbg/edit#gid=711075203工作表: https : //docs.google.com/spreadsheets/d/1Of6cdFYaOzCFwPdZ4ABItD6dghMjHhafRWmDJWaznbg/edit#gid=711075203
You have to use group by
您必须使用
group by
To get just for Thailand Tour
只为
Thailand Tour
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
To get results for the whole column try this要获得整个列的结果,试试这个
=iferror(QUERY(importorders!A:H,"Select count(A) where month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
(A demo sheet with expected results would be really helpful) (具有预期结果的演示表会非常有帮助)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.