Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to filter by the field whose value is the link to the current page #1167

Closed
leventov opened this issue Jun 8, 2022 · 2 comments · Fixed by #1283
Closed

Document how to filter by the field whose value is the link to the current page #1167

leventov opened this issue Jun 8, 2022 · 2 comments · Fixed by #1283
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@leventov
Copy link

leventov commented Jun 8, 2022

https://blacksmithgu.github.io/obsidian-dataview/query/queries/

Describe the problem
Let's say I have a link-valued page attribute system. I want to have a template for pages that shows all files that have this attribute equal to the link to the current page.

The only solution that I've found working after long trial and error was:

```dataviewjs
dv.table(["File"], dv.pages()
  .where(p => p.system.path == dv.current().file.path)
  .map(p => [p.file.link]))

And, remarkably, no way to make such a query using Dataview query syntax. Or, at least I haven't found a way to do this.

I think would be nice to document this, maybe adding to the query examples.

@leventov leventov added the documentation Improvements or additions to documentation label Jun 8, 2022
@mnvwvnm
Copy link
Collaborator

mnvwvnm commented Jun 8, 2022

In DQL:

TABLE WITHOUT ID file.link AS "File"
WHERE system = this.file.link

@AB1908
Copy link
Collaborator

AB1908 commented Jul 1, 2022

Thanks for the suggestion!

@AB1908 AB1908 closed this as completed Jul 1, 2022
@AB1908 AB1908 linked a pull request Jul 25, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants