I specify a key ‘category’ for each book note, and it may contains a link the category note.
Obsidian provides a backlink table below the category note, which is great, e.g.:
metadata
category:: [[02 MOC-PROGRAMMING]]
Using dataview TABLE query:
table category, topic
from #book
WHERE category.value = "[[02 MOC-PROGRAMMING]]"
Well, it returns
What I’m trying to do
According to the Dataview documentation, the link field type is valid for data annotation, how can I use it in a query statement for comparison? The document says:
[[Link]].value would get the value value from page Link .
Key:: [[Link]] , then you should index into it by just writing Key.value ;
Hi.
Your category field use only one value (in the case, only one link)?
If yes:
TABLE category, topic
FROM #book
WHERE category = [[02 MOC-PROGRAMMING]]
Notes:
in the query, don’t use “…” for links > quotations are used for strings, not for links
about [[Link]].value, in practical means this:
taking your example, for category:: [[02 MOC-PROGRAMMING]], let’s say you have a field called field in your note “02 MOC-PROGRAMMING”… [[Link]].value means that you can query the field through the link in category. In the query below, category.field gives you the value in the field inside the note [[02 MOC-PROGRAMMING]].
TABLE category, topic, category.field
FROM #book
WHERE category = [[02 MOC-PROGRAMMING]]