Google Sheet Query - Group / concatenate multiple rows
<p>I'm running a <code>QUERY</code> with a <code>SUM</code> and <code>GROUP BY</code>, but I'd like to aggregate multiple distinct values from the rows into a single row and column. I'm looking to concatenate all those values together.</p>
<p><strong>Current Table:</strong></p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Person</th>
<th>Widget</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bill</td>
<td>Red</td>
<td>12</td>
</tr>
<tr>
<td>Bill</td>
<td>Blue</td>
<td>9</td>
</tr>
<tr>
<td>Sarah</td>
<td>Yellow</td>
<td>4</td>
</tr>
<tr>
<td>Bill</td>
<td>Yellow</td>
<td>1</td>
</tr>
<tr>
<td>Sarah</td>
<td>Orange</td>
<td>10</td>
</tr>
</tbody>
</table>
</div>
<p><strong>Expected Table</strong>:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Person</th>
<th>Widget</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bill</td>
<td>Red, Blue, Yellow</td>
<td>22</td>
</tr>
<tr>
<td>Sarah</td>
<td>Yellow, Orange</td>
<td>14</td>
</tr>
</tbody>
</table>
</div>