Hey @Alejandro, and welcome to the community! Sorry for the delay, we're usually quicker
You can do this in Retool via Javascript, but it's going to be kind of gnarly - I'd recommend you actually do this in Google Sheets (perhaps in a separate sheet, so you can create a separate query) and then import into Retool. You'd need to either write a custom JS function (see here) or use Lodash's grouping functionality.