Hello, is it possible to create a table with Dataview and group lists by tags? Let me detail it with an example.
I have three notes:
2024-02-28.md
- lorem ipsum #AI
- lorem ipsum #Business
- lorem ipsum #Code
2024-02-29.md
- lorem ipsum #AI
2024-03-01md
- lorem ipsum #Business
- lorem ipsum #Code
- lorem ipsum #Code
And I want to have this as result:
| Tag | File | Text |
| --------- | ---------- | ------------- |
| #AI | 2024-02-28 | - Lorem ipsum |
| #AI | 2024-02-29 | - Lorem ipsum |
| #Business | 2024-02-28 | - Lorem ipsum |
| #Business | 2024-03-01 | - Lorem ipsum |
| #Code | 2024-02-28 | - Lorem ipsum |
| #Code | 2024-03-01 | - Lorem ipsum |
| #Code | 2024-03-01 | - Lorem ipsum |
I’m using those Dataviews but I don’t figure out how to combine both
For list all tags per notes:
TABLE LENGTH(rows.file.name) AS Count
FROM "Daily Notes/2024"
FLATTEN file.tags AS Topic
GROUP BY Topic
SORT LENGTH(rows.file.name) DESC
And for displaying all lists with tag “#AI”:
TABLE
L.text AS Subject
FROM "Daily Notes/2024"
FLATTEN file.lists AS L
WHERE CONTAINS(L.tags, "#AI")
SORT file.name ASC
Thanks in advance!