Dataview and field question

Assuming I have

  • a directory mytest/ in the Obsidian Vault
  • in mytest/ I have notes which may contain Bla:: [[X]], Bla:: [[Y]] aso.

I like to build a table where

  • the first column has [[X]], [[Y]] aso.
  • and the second column has the number of occurrences of Bla:: [[ X]], Bla:: [[Y]] aso.

I have no idea how to achieve this.

First of all, what’s the “aso” for? Is this the same as “also” ? For I can’t wrap my mind around it :sweat_smile:


Now, assuming I understood correctly, you need a table that counts the occurrences of [[X]] and [[Y]] from the Bla metadata property? If that’s so, here’s what I have come up with:

TABLE WITHOUT ID Bla, length(rows.Bla) AS Count
FROM "mytest"
FLATTEN Bla
WHERE contains(string(Bla), "X") OR contains(string(Bla), "Y")
GROUP BY Bla
Bla Count
[[X]] 3
[[Y]] 11

aso means there can be many different fields. There could be anything else besides X or Y.

Bla:: [[hi]], Bla:: [[whatever]] .

In that case, here’s the code that lists all Bla links and their number of occurrences across notes:

TABLE WITHOUT ID Bla, length(rows.Bla) AS Count
FROM "mytest"
FLATTEN Bla
WHERE Bla
GROUP BY Bla
Bla Count
[[X]] 3
[[Y]] 11
[[Whatever]] 4
[[Testing]] 1
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.