Using Dataview but I'm doing something wrong

A beginner with Dataview. My Obsidian folder in my Documents folder (Mac) has two vaults. I’m using one vault with two notes as a testbed. One note has the following at the top:


module: “Note”
dueDate: “2021-07-03”
rank: 5

The second note has:


module: “Note”
rank: 4

My query in a third note in vault “Testbed” has:

TABLE file.ctime, rank
FROM "" 

** Results:
1). This produces a table with ALL notes listed in each of the two vaults (with correct ctime column), but the “rank” column has “-” for each note, even the two indicated above.
2) If I use FROM “Testbed” (the test vault with the two notes above), I get nothing.
3) If I use FROM “Dataview”, the only folder in Testbed that contains the two notes, I get nothing.
4) If I replace the TABLE line in each of the two notes to “TABLE file.ctime, module” ,the query result has “-” for each file in the “module” column. The value “Note” does not appear.

** Questions:
a) Is there a problem with syntax of the FROM in (2) and (3)?
b) My query tests must be missing something (do I have the right syntax?).

I’ve search endlessly the various examples people have posted, here and in google searches in general, and I can’t find a solution to my problem.

Many questions:

  1. Vaults or folders? How many ‘Obsidian’ are open? If you have only one with FOLDERS inside named “Testbed” and (other one), these are folders, not ‘vaults’!
  2. How you create your fields (module, dueDate, rank)? Inside a frontmatter or inline fields?
  3. FROM selects the source from “folders”, “tags” and “links”, not “vaults”.

Plugin Documentation:

Could you post a screenshot of one of your notes in edit mode?

Also try changing the query to,

TABLE file.ctime, rank
FROM "" 
WHERE rank

to limit the results to notes which have the rank field.

  1. I have one Obsidian invoked.

Well, I guess I have a basic misunderstanding. I originally created a new MacOS folder “-Obsidian” in my Documents folder. My intention was to use that to store vaults. That’s where I defined my first vault, “MyVault”. Then I decided to create another vault as a testbed for Dataview.

a) In Obsidian, I clicked the “Open another vault” icon and clicked “Create new vault”. I entered a vault name, “Testbed”, and for the location I chose “-Obsidian”.

b) In the main Obsidian window, left panel, I have the original vault, say “My vault”, and now “Testbed”, both listed under “-Obsidian”.

So I assumed Testbed is a vault, since I created it as a “new vault”.

However, when I invoke “Open another vault”, that pop-up window has its own left panel and it lists “-Obsidian”, and “Testbed”, as well as “Obsidian Help” as available vaults, but not “My vault”. – so this may be the beginning of my problems.

I’ll have to experiment a bit more with folders/vaults.

  1. The fields use frontmatter; here’s the complete code for the first note (second note is similar):

module: “Note”
dueDate: “2021-07-03”
rank: 5

  1. Many of the examples I’ve seen use From “”. I figured that would define the source as everything. But I did try From “Testbed”, and From “Dataview” (which is a folder under Testbed.

I changed the query to your suggestion and the query now works.

TABLE file.ctime, rank
FROM "" 
WHERE rank

I was also adding extra lines/blanks in the notes, before following your suggestion, so I’m not sure if any of that affected the outcome. BTW, I put my original code for the query back in and that also works (with all the notes). Also if I now use

TABLE file.ctime, rank, module

Go figure. Now to return to my folder / vault situation…

Thanks to both of you for your help and inspiration.

Ok, you have “vaults” inside “vaults” (working like folders). I didn’t know that possibility. But I think there’s some limitations: Multiple Vault/Directory Support - #8 by WhiteNoise

Good to hear!

I think you might have accidentally chosen -Obsidian as a vault. So you have a vault and another vault inside that vault. To confirm, you can just open the Help Vault and then when you select the open another vault button, you’d see all the other vaults and you can deduce which ones are setup.

Yes, that must have been what I did. Thanks.

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