I want to create a table of my projects grouped by status (idea, running, finished,…).
I use subtags to define the status of the projects, so its #project and #status/running in the top section of the note.
The table should be defined like:
TABLE name.link
FROM #Project
GROUP by #Status/
and then all projects are gouped by there current status.
Is this possible?
I know I could define a new dataview variable “status” and group by it, but I use the tag system a lot and want to be able to use the obsidian search tag option.
Things I have tried
Using GROUP by tag I get all tags.
Using GROUP by #status, I get an error that “#” is not valid
Using Group by tag (‘#Status/’) I get an error that “(” is not valid
1 - to get only the exact tags (and not “nested tags + parent tags”), use file.etags instead of file.tags;
2 - to separate groups of tags (because in each file you have multiple tags), you need to flatten them >>> FLATTEN file.etags AS Tags (“Tags” is the new name to the new list of tags);
3 - after FLATTEN, you need to exclude all the unwanted tags (for example, #project), in the case using the filter WHERE contains(Tags, "#status/") (only tags with “#status/”);
4 - now, finally, you can group them:
```dataview
TABLE WITHOUT ID Tags AS "Status", rows.file.link AS "Files"
FROM #Project
FLATTEN file.etags AS Tags
WHERE contains(Tags, "#status/")
GROUP BY Tags
SORT Tags DESC
```
5 - I deduce you want to sort status tags not alphabetically but in the order “idea” > “running” > “finished”. You can’t achieve this sorting tags using only “ASC” or “DESC”. You need to create your wanted order. I give you an option with a “constructed” order:
```dataview
TABLE WITHOUT ID Tags AS "Status", rows.file.link AS "Files"
FROM #Project
FLATTEN file.etags AS Tags
WHERE contains(Tags, "#status/")
GROUP BY Tags
SORT choice(contains(Tags, "idea"), "1", choice(contains(Tags, "running"), "2", choice(contains(Tags, "finished"), "3", "4"))) ASC
```