Many years ago I would inject SQL in my reports Pre/Post VLDB settings to get a comma separated list of my attribute elements. There is a better and much easier method. It's also a bonus that it is dynamic and can be updated using filters directly on the document/dossier.
First let's take a look at the dossier below. It shows Countries by GDP $'s by year.
I want to add a dynamic box at the bottom to display the Counties in a comma separated format (in a grid visualization). To do this I create a a concatagg metric on my country attribute. see my metric definition below.
Now I add this metric to my Dossier to show the comma separated values based on the filter.
And that's it!