file.tags vs tags(frontmatter)
See original GitHub issueDescribe the bug Using GROUP BY / FLATTEN in dataview query I’m able to obtain the expect result if work with “tags” via frontmatter (except the fact that the tag not be an ‘active/clickable’ element). That’s not possible with “file.tags”.
To Reproduce
- Query with “tags”:
TABLE join(rows.file.link, ", ") AS Files
WHERE tags
FLATTEN tags
GROUP BY tags
Group | Files |
---|---|
tag1 | File A |
tag2 | File A, File B |
tag3 | File C |
tag4 | File A, File D |
tag5 | File D |
tag6 | File A, File C, File D |
The table is grouped as wanted - tag by tag -, although tags are not ‘active’ elements.
- Query with “file.tags”
TABLE join(rows.file.link, ", ") AS Files
FROM "Teste2"
WHERE tags
FLATTEN tags
GROUP BY tags
Group | Files |
---|---|
#tag1 #tag2 #tag4 #tag6 |
File A, File A, File A, File A |
#tag2 | File B |
#tag3 #tag6 |
File C, File C |
#tag4 #tag6 |
File D, File D |
The table isn’t grouped as wanted - tag by tag -, although tags are now ‘active’ elements.
Expected behavior A mix of the two previous results: a table grouped as in case 1 with ‘active’ tags as in case 2.
Desktop (please complete the following information):
- OS: macOS BigSur
- Obsidian Version: v0.12.15
- Dataview Version: 0.4.8
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
YAML tags vs Normal tags in Obsidian : r/ObsidianMD - Reddit
I would like to use YAML tags for dataview (also heard that Tags in… ... the front matter (and do another things to...
Read more >Front Matter | Jekyll • Simple, blog-aware, static sites
The front matter must be the first thing in the file and must take the form ... use Liquid tags and variables but...
Read more >Tags and frontmatter - Feature requests - Obsidian Forum
I have a use-case where I am using Obsidian to write the content that will be presented via mkdocs which has caused some...
Read more >Front-matter | Hexo
Only posts support the use of categories and tags. Categories apply to posts in order, resulting in a hierarchy of classifications and sub- ......
Read more >Creating Tags Pages for Blog Posts - Gatsby
You add tags by defining them in the frontmatter of your Markdown file. The frontmatter is the area at the top surrounded by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This mostly appears to be a UX problem with GROUP BY doing something stupid with variables with dots in them. I may be able to fix the behavior.
Ah, the reason your second query is due to a bad Dataview interaction with how GROUP BY works - it makes a variable literally called
"file.tags"
, which you have to obtain viarow["file.tags"]
. I would useGROUP BY file.tags AS tag
to rename it to something usable.