Direct answer: you can’t do that with dataview.
Unless you have code knowledge and create a complex code to do a manual parsing of the full content…
Dataview works with metadata, not with the full content… and md tables aren’t metadata.
Dataview docs: Dataview
Thanks @mnwvnm would there be alternative way using dataview. The information doesn’t need to be in tables. Say I had
Note1
foo:: Lorem ipsum dolor sit amet
bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt
baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. #notes/hello
foo:: Lorem ipsum dolor sit amet
bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt
baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. #notes/goodbye
Note 2
foo:: Lorem ipsum dolor sit amet
bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt
baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. #notes/hello
Note 3
TABLE foo, boo, baz FROM #notes/hello
SORT bar DESC
The above query returns all tags #notes/hello and #notes/goodbye and doesn’t sort by bar
TABLE foo, bar, baz FROM "folder"
Where contains(tags, "notes/hello")
SORT bar DESC
This is a recurrent misunderstanding.
You’re thinking that your data works as pseudo-groups inside the same note. That’s no true. Your data works mainly in page level.
I think I explained this multiple times in this Forum. But remains a recurrent error thinking as a group/blocks of metadata.
For example, in your note 1 you have two tags at page level, not related with each pseudo-group.
To play with dataview we need to understand first the metadata structure.
If you want to see the metadata structure in specific file, place this inline js query in that note:
To be honest I think this is too complicated for me and doesn’t seem to do a lot of what I thought it would do. I assumed it would be a simple task to pull data from other files based on a tag.
I might need to sadly go back to Notion which was much easier to understand and use
It’s easy to pull out data from other files based on a tag… But the main issue in your metadata structure is: you also want “groups” of data inside the same file.
I used Notion databases (in basic way), but I think there the issue is the same: in Notion you need to define data per file, not groups inside the same file.
With dataview you can create a kind of groups if you use data based in a common value.
For example, it’s possible to collect all list itens (bullet point lists) or task based in the header/section.
An example
Note 1
## hello
- foo:: Lorem ipsum dolor sit amet
- bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt
- baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
## goodbye
- foo:: Lorem ipsum dolor sit amet 2
- bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt 2
- baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 2
Note 2
## hello
- foo:: Lorem ipsum dolor sit amet 3
- bar:: consectetur adipiscing elit, sed do eiusmod tempor incididunt 3
- baz:: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 3
One possible query for lists under the header “hello”:
TABLE WITHOUT ID
key AS File,
filter(rows.L, (r) => r.foo).foo AS foo,
filter(rows.L, (r) => r.bar).bar AS bar,
filter(rows.L, (r) => r.baz).baz AS baz
FROM "your/folder/path"
FLATTEN file.lists AS L
WHERE meta(L.section).subpath = "hello"
GROUP BY file.link
SORT rows.L.bar DESC
Ok thanks for explaining where I was going wrong. I have a little better understanding of what dataview can do. Will try this and feedback how I get on. thanks for all your detailed responses