如何在 Google 工作表中创建逗号分隔聚合?

How to create a comma separate aggregate in Google Sheets?

给定以下数据集:

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

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

我如何编写 QUERY(或任何其他有意义的内容),以便 C 列显示给定人员所在频道的逗号分隔列表?

例如,我想要以下输出。

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

尝试:

=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)), "×")), ",$", ))