```dataview
TABLE WITHOUT ID tag AS "Tag", (rows.file.link) AS "Notes", join(rows.file.etags, "<br>") as "Tags"
FLATTEN file.etags AS tag
GROUP BY tag
SORT file.ctime DESC
```
What I’m hoping for help with: Since I’m already grouping by tag (left column), how can i remove that tag from the list of the other tags (right column) that are contained in each file (middle column). In other words, I want the screen-shot but without the tags marked with the hand-drawn red “x”s, since each is already on the right side for the respective row.
I believe the answer is in the join statement, where in rows.file.etags I need to exclude the tag for that entry. But I’m not sure how to write this.
3.To FLATTEN file.etags AS etag: 3.1 To break up a list like file.etags in a file into each individual element in a file 3.2 To define a field variable etag as each element of file.etags of each page
4.To group by etag
5.To define a field variable etags_joined
6.To display the result as a table
Code DQL01_FLATTEN_etags_groupBy_etag_and_TABLE
Summary_code
title: DQL01_FLATTEN_etags_groupBy_etag_and_TABLE =>1.To filter by `file.etags` 2.To sort by `file.ctime` in descending order 3.To FLATTEN file.etags AS etag: 3.1 To break up a list like `file.etags` in a file into each individual element in a file 3.2 To define a field variable `etag` as each element of `file.etags` of each page 4.To group by `etag` 5.To define a field variable `etags_joined` 6.To display the result as a table
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
key AS "Tag(key)",
rows.file.link AS "Notes",
etags_joined as "Tags"
FROM "100_Project/02_dataview/Q74_GroupBy_etag/Q74_test_data"
WHERE file.etags
SORT file.ctime DESC
FLATTEN file.etags AS etag
GROUP BY etag AS G_etag
FLATTEN "• " + join(rows.file.etags, "<br>• ") AS etags_joined
```
3.To FLATTEN file.etags AS etag: 3.1 To break up a list like file.etags in a file into each individual element in a file 3.2 To define a field variable etag as each element of file.etags of each page
4.To group by etag
5.To define a field variable etags_joined
6.To remove the key from the etags_joined
7.To display the result as a table
1.The DQL03 is based on the DQL01. 1.1 Purposes 6 is added.
title: DQL03_GroupBy_etag_and_Remove_key_from_etags_joined_and_TABLE =>1.To filter by `file.etags` 2.To sort by `file.ctime` in descending order 3.To FLATTEN file.etags AS etag: 3.1 To break up a list like `file.etags` in a file into each individual element in a file 3.2 To define a field variable `etag` as each element of `file.etags` of each page 4.To group by `etag` 5.To define a field variable `etags_joined` 6.To remove the `key` from the `etags_joined` 7.To display the result as a table
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
key AS "Tag(key)",
rows.file.link AS "Notes",
etags_excluding_key as "Tags"
FROM "100_Project/02_dataview/Q74_GroupBy_etag/Q74_test_data"
WHERE file.etags
SORT file.ctime DESC
FLATTEN file.etags AS etag
GROUP BY etag AS G_etag
FLATTEN "• " + join(rows.file.etags, "<br>• ") AS etags_joined
FLATTEN regexreplace(etags_joined, key, "") AS etags_excluding_key
```
3.To FLATTEN file.etags AS etag: 3.1 To break up a list like file.etags in a file into each individual element in a file 3.2 To define a field variable etag as each element of file.etags of each page
4.To group by etag
5.To define a field variable etags_joined
6.To remove the key and extra comma from the etags_joined
7.To display the result as a table
1.The DQL10 is based on the DQL03. 1.1 Purposes 6 is modified.
title: DQL10_GroupBy_etag_and_Remove_key_and_extra_comma_from_etags_joined_and_TABLE =>1.To filter by `file.etags` 2.To sort by `file.ctime` in descending order 3.To FLATTEN file.etags AS etag: 3.1 To break up a list like `file.etags` in a file into each individual element in a file 3.2 To define a field variable `etag` as each element of `file.etags` of each page 4.To group by `etag` 5.To define a field variable `etags_joined` 6.To remove the `key` and extra comma from the `etags_joined` 7.To display the result as a table
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
key AS "Tag(key)",
rows.file.link AS "Notes",
etags_excluding_key_and_comma as "Tags"
FROM "100_Project/02_dataview/Q74_GroupBy_etag/Q74_test_data"
WHERE file.etags
SORT file.ctime DESC
FLATTEN file.etags AS etag
GROUP BY etag AS G_etag
FLATTEN "• " + join(rows.file.etags, "<br>• ") AS etags_joined
FLATTEN regexreplace(etags_joined, key + ",|, " + key + "|" + key + "(?!/)" , "") AS etags_excluding_key_and_comma
```
Thanks @holroy for your reply (and sorry for the delay; damn forum not notifying me!).
Unfortunately that didn’t work. I’ve been playing a bit but no dice. I’m at a bit of a loss. Here’s where the query is at:
```dataview
TABLE WITHOUT ID tag AS "Tag", (rows.file.link) AS "Notes", join(filter(rows.file.tags, (t) => t != tag), "<br>") as "Tags"
FLATTEN file.tags AS tag
GROUP BY tag
SORT file.ctime DESC
```
The query itself works fine. It just doesn’t remove the current tag (from “Tag”) in the list of all tags (in “Tags”) for each note.
EDIT: In fact, even if I hard-wire one of my tags in, it still doesn’t filter it out. E.g.
join(filter(rows.file.tags, (t) => t != "#active-gals")