Dataview: this.path return - (dash)

Things I have tried

Listing the entire file such as with

LIST file

The path is displayed correctly but selecting only the path:

LIST file.path

Will simply display - (dash)

What I’m trying to do

I have a query that runs through files based on a tag. The file with the query also has it but I wish to excluded itself from the query

Example


```dataview

LIST
FROM ""
WHERE econtains(file.tags, "#sometag") AND file.path != this.path (tried with file != this as well but no luck)
SORT file.name ASC


<!-- THIS PART WON'T BE POSTED

Please describe what you're trying to accomplish so the community can better help you. Sometimes the solution you have in mind is not necessarily the best option, in which case knowing some background info can let others come up with creative solutions for your use case.

Please continue below this line. -->

file point to the implicit fields at page level.
If you want a comparison with the path of the current file, you can use the prefix this… but you need to point again to the file level data, i.e., this.file.path (not this.path).

You are right. I do have a this.file usecase elsewhere but forgot about it. Just started out with Obsidian and going through plenty of things so not all things are sticking yet.

Thanks for the quick reply!

About the query, for the tag filter you can use FROM:

LIST
FROM #tag
WHERE file.path != this.file.path
SORT file.name ASC

edited: sorry, I wrote commas. don’t need them (only for folders).

That is a lot more elegant thanks again

And yes I just tried it and noticed it only worked without quotes hehe

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