I’m back…
Well, my last answer is a mess… because here…
… I wanted to said with DQL (I don’t know JS) you CAN'T achieve completely what you want
, that’s why the next expression with “…you can’t use an embed query”.
Because this error is embarrassing (giving “false” expectations) I forced myself to find some solution.
So, if you want the same query to use in multiples files and placed in only one place to easily made future changes, my solution is a mix of DQL and a basic DVJS.
Create one note only with your wanted query. For example, the note “Query.md” in the folder folderA
with your dataview query (only the query, nothing more). For test purposes you can use your query above.
Then, let’s place the query in the other notes. For that we’ll load the content of the “Query.md” file, not as an embed but as a “real” content, using a dvjs command await dv.io.load()
…
In your notes place this inline js query (you need to enable js queries in settings > dataview):
`$=dv.span(await dv.io.load("folderA/Query.md"))`
Try and tell me if this works, because I’ve never used it.
[ I think there’s another way with dvjs command dv.view()
, but that implies a JavaScript file and that is beyond my limited knowledge ]