Dataview query from a specific folder

Hello Everyone, I have a pretty « noobish », dataview related, question

I’m using a little query to organise my related notes with an index. For now is use this to call other notes in my index :

LIST
from [[PROG - Programmes lycée - 0 - INDEX]]
where file.name != "PROG - Programmes lycée - 0 - INDEX"
sort file.name asc

And i put this at the top of my notes to go back up to the index :

(index :: [[PROG - Programmes lycée - 0 - INDEX]])

—-

My problem is that the index display other notes that have backlinks to it, from other folders in my vault.
Let’s say I have for example :

Note 0 - index
Note 1 -
Note 2 -
Etc.

Assuming that all of them are in the same folder. How can I call for those notes ONLY in the index, excluding the ones that are in the rest of my vault ?

Am I understanding correctly that your index notes are called index name.md
and every note that belongs in an index has (index::[[index name]]) in it? If so, then you could put this in your index note to get the full index:

```dataview
list
where index = [[index name]] and file.name != this.file.name
sort file.name asc
```

The statement FROM [[index name]] means, “give me all the notes that link to ‘index name.md’” (paraphrased!), which is what you were getting.

Oh. Just tried this and it worked like a charm. Thanks a lot. Dataview can be pretty powerfull, but I still have a lot to learn about it. :slight_smile: (for example, the difference between « FROM » an « WHERE » is still a bit confusion for me :sweat_smile:)

I think of FROM as looking at specific sources and WHERE as filtering.

In your case, it’s not about limiting the sources, because you want to look in all of your notes for links to the index note. So the from line you had was no help and added sources you didn’t want.

On the other hand, if you do have a way to limit your sources—for instance, if all the linked notes are in a folder called “educación/lycée” or have the tag #lycée—then adding a FROM statement would be more efficient. As in:

FROM "educación/lycée"

or

FROM #lycée

All the best to you.