如何在Google表中创建逗号分开的聚合?

发布于 2025-01-30 19:34:24 字数 655 浏览 4 评论 0 原文

给定以下数据集:

**people**  **channel**
person1 channel1
person2 channel1
person1 channel2
person3 channel2

我如何编写查询(或其他任何使Sendent sensence sensence)显示 c c 列的列表,以显示 c 列的列表。给定的人在吗?

例如,我想要以下输出。

**people**  **channel**
person1 channel1 channel1, channel2
person2 channel1 channel1
person1 channel2 channel1, channel2
person3 channel2 channel2

Given the following data set:

https://docs.google.com/spreadsheets/d/1wr7v93CM_kWygRNHyqMWcBFvd1XXkC5SYbjLjauS4SM/edit?usp=sharing

**people**  **channel**
person1 channel1
person2 channel1
person1 channel2
person3 channel2

How could I write a QUERY (or anything else that makes sense) such that the C column shows a comma separated list of the channels that a given person is in?

For example, I'd like the following output.

**people**  **channel**
person1 channel1 channel1, channel2
person2 channel1 channel1
person1 channel2 channel1, channel2
person3 channel2 channel2

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

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

发布评论

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

评论(1

伴我心暖 2025-02-06 19:34:24

尝试:

=ARRAYFORMULA(REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(QUERY({A2:A&"×", B2:B&",", ROW(A2:A)}, 
 "select max(Col2) where Col2 <> ',' group by Col3 pivot Col1"),,9^9)), "×")), ",$", ))

alt

try:

=ARRAYFORMULA(REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(QUERY({A2:A&"×", B2:B&",", ROW(A2:A)}, 
 "select max(Col2) where Col2 <> ',' group by Col3 pivot Col1"),,9^9)), "×")), ",
quot;, ))

enter image description here

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