订单计数和过滤的Google表格查询结果

发布于 2025-01-22 08:12:05 字数 754 浏览 1 评论 0原文

我正在研究Google表,旨在帮助分析与营销相关的KPI。为此,我创建了(或从不同来源进行研究)我的第一个查询,该查询根据一列“日期”查找不同表格中的不同列,同时计算出现了多少次不同的值出现。 现在,我也想根据计数值对此查询进行排序。

当前的代码看起来像这样:

=QUERY(UNIQUE(QUERY(
Gruppenname_klaeren!A3:I;"SELECT * WHERE I is not null 
and B >= date'"&TEXT(today()-A2;"yyyy-mm-dd")&"'
and B <= date '"&TEXT(today();"yyyy-mm-dd")&"'
label I 'Kampagne'")); 
"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs'")

老实说,代码感觉像是一团糟 - 但这是我唯一可以使其正常工作的方法。现在,我想根据计数值(COL3)订购结果,但是只需以以下方式插入此结果:

"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs' order by count(Col3) desc")

如果有人知道为什么这不起作用,我真的很感谢您的帮助。

谢谢!

I am working on a Google Sheet intended to aid in the analysis of Marketing-related KPIs. For this, I have created (or rather researched from different sources) my first Query, which looks up different columns from a different sheet based on one column "date" and groups them while counting how many times different values appear.
Now, I would like to also sort this query by the counted values.

The code currently looks like this:

=QUERY(UNIQUE(QUERY(
Gruppenname_klaeren!A3:I;"SELECT * WHERE I is not null 
and B >= date'"&TEXT(today()-A2;"yyyy-mm-dd")&"'
and B <= date '"&TEXT(today();"yyyy-mm-dd")&"'
label I 'Kampagne'")); 
"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs'")

Honestly, the code feels like a mess – but that's the only way I could make it work. Now, I would like to order the results based on the values of count(Col3), but just inserting this in the following way doesn't work:

"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs' order by count(Col3) desc")

If anyone knows why this doesn't work, I'd really appreciate the help.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2025-01-29 08:12:05

尝试

=SORT(QUERY(UNIQUE(QUERY(
Gruppenname_klaeren!A3:I;"SELECT * WHERE I is not null 
and B >= date'"&TEXT(today()-A2;"yyyy-mm-dd")&"'
and B <= date '"&TEXT(today();"yyyy-mm-dd")&"'
label I 'Kampagne'")); 
"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs'");3;0)

我已经通过排序(___________; 3; 0)

1 = ASC 封装了您的公式
0 = desc

Try

=SORT(QUERY(UNIQUE(QUERY(
Gruppenname_klaeren!A3:I;"SELECT * WHERE I is not null 
and B >= date'"&TEXT(today()-A2;"yyyy-mm-dd")&"'
and B <= date '"&TEXT(today();"yyyy-mm-dd")&"'
label I 'Kampagne'")); 
"SELECT Col9, count(Col3) WHERE Col9 is not null GROUP BY Col9 label count(Col3) 'Anzahl GKs'");3;0)

I have encapsulated your formula by sort(___________;3;0)

1 = ASC
0 = DESC

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文