I think you’re almost there, but it’s hard to say as we don’t see too much of you base data. I’m guessing that this result might come from the fact that you’re grouping the roles together, and it then makes the single values as into lists, so that what we’re looking at is actually a list of all the unique roles.
A lengthy FLATTEN and GROUP BY example
role:: Contagonist
role:: Antagonist
role:: Hero
role:: Contagonist
role:: Hero
role:: Hero
role:: Contagonist
role:: Hero
## Just a list
```dataview
LIST WITHOUT ID role
WHERE file.name = this.file.name
```
## List with flatten
```dataview
LIST WITHOUT ID R
FLATTEN role as R
WHERE file.name = this.file.name
```
## Table with flatten and group by
```dataview
TABLE WITHOUT ID R, rows.R
FLATTEN role as R
WHERE file.name = this.file.name
GROUP BY R
```
My somewhat lengthy example, which I suggest you run in your own setting in a note of its own, produces the following output for me:
What we see here is that the two first LIST
variations, show first the entire list of roles in a single row, the first bullet point, as a list within that row, the multiple bullet points on the second level.
Next, after the FLATTEN
, we see that it now shows each role on a separate row, as all the bullet points are on the first level.
Lastly, in the third example, I’ve used both FLATTEN role as R
and GROUP BY R
, and in the first column it shows the unique role (which you’re looking for), and in the second column it shows three lists (one row for each unique row) of all the role’s having that particular value, the rows.R
(aka all the rows
of R
which are now grouped together).
If I skipped adding the rows.R
to the last example, it would only show the actual unique roles you’re looking for. And maybe, just maybe, your issue is that you didn’t give your flattened value a name (using AS something
and just used FLATTEN role
which could lead to some ambiguity later on.
Summary I think, but I don’t know, since we don’t see your actual query, that the image you produced is showing the equivalent of my rows.R
instead of the just the R
. So if my explanation above doesn’t help you to understand how your query is wrong, please provide your query and the result of it, and possible with some data leading up to it.