# I want to get all the tags I've used in my vault and the count of all unique tags displayed in one line

**URL:** <https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062>\
**Category:** Help\
**Tags:** dataview\
**Created:** [January 16, 2024, 5:10am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062 "2024-01-16T05:10:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![luismadrigal](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@luismadrigal](https://forum.obsidian.md/u/luismadrigal)\
**Post date:** [January 16, 2024, 5:10am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/1 "2024-01-16T05:10:30Z")

</div>

### What I’m trying to do

So I want to have quick summary of all the available tags in my vault and number (count) of tags, in one line.

Something like this:

| Total Unique Tags (198) | Tags |
| --- | --- |
| 198 | #programming, #obsidian, #dataview, #log, #snippets, #table, #list, #task, #linux, #macos, #api, #blogs, #archive, #python, #ruby, #productivity, #books, #bugs, #documentation, #experimental |

### Things I have tried

This gives a list of tags and the number times that tag is used. Now I want to get that list and one count the number of unique tags and then join them to one line.

```dataview
LIST WITHOUT ID length(rows) + " note(s) with tag " + " " + tgs
FROM "/"
WHERE file.etags
FLATTEN file.etags AS tgs
GROUP BY tgs
SORT length(rows) DESC

```

I have no idea whether that is possible, I think it. I just hope that I don’t have to use dataviewjs as I’m not at all versed in that.

I searched the forum, but I didn’t find anything close to what I’m trying to do, perhaps I’m bad at describing it in search terms. If this already exists please point me to the post.

Anyway, any help on this would be greatly, appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![holroy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/holroy/32/77699_2.png) [@holroy](https://forum.obsidian.md/u/holroy)\
**Post date:** [January 19, 2024, 12:52am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/2 "2024-01-19T00:52:09Z")

</div>

This is not tested, and I’m not sure whether it’s the most efficient way of doing it. But it could work…

````auto
```dataview 
TABLE WITHOUT ID length(rows) as "Tag count", join(rows.unique, ", ") as "Unique tags"
WHERE file.etags
FLATTEN file.etags as tag
GROUP BY tag
FLATTEN rows.tag[0] as unique
GROUP BY true
```

````

---

<div class="post-metadata">

**Author:** ![luismadrigal](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@luismadrigal](https://forum.obsidian.md/u/luismadrigal)\
**Post date:** [January 19, 2024, 1:17am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/3 "2024-01-19T01:17:43Z")

</div>

Wow!! This is exactly what I’m looking for!!! It shows all the tags nice sorted alphabetically.

Thank you!!

---

<div class="post-metadata">

**Author:** ![luismadrigal](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@luismadrigal](https://forum.obsidian.md/u/luismadrigal)\
**Post date:** [January 19, 2024, 2:51am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/4 "2024-01-19T02:51:48Z")

</div>

I think I understand most of it except the last grouping?

Why “GROUP BY true” ? How did you come up with that?

---

<div class="post-metadata">

**Author:** ![holroy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/holroy/32/77699_2.png) [@holroy](https://forum.obsidian.md/u/holroy)\
**Post date:** [January 19, 2024, 8:02am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/5 "2024-01-19T08:02:48Z")

</div>

The first group by is used to group by tag, aka single out unique tags and gatherc each n of them in list under each tag. The last group by is just used too gather all the rows of tags into a single row.

---

<div class="post-metadata">

**Author:** ![luismadrigal](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@luismadrigal](https://forum.obsidian.md/u/luismadrigal)\
**Post date:** [January 19, 2024, 9:28am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/6 "2024-01-19T09:28:40Z")

</div>

I am mean I had no idea that “GROUP BY true” was even thing.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [January 26, 2024, 9:28am UTC](https://forum.obsidian.md/t/i-want-to-get-all-the-tags-ive-used-in-my-vault-and-the-count-of-all-unique-tags-displayed-in-one-line/75062/7 "2024-01-26T09:28:56Z")

</div>

Closed on January 26, 2024, 9:28am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
