Dataview query filtering using file name OR aliases

What I’m trying to do

I have two templates, one for company, the other for people.

On a specific company note I would like to query people notes where the property of current-org is equal to the company note.

Things I have tried

This query works:

TABLE current-org, current-role
FROM "Z"
WHERE current-org = [[Super Company Ltd ]]

However the issue I have is some of the links in the frontmatter for current-org either use the file name OR an alias e.g.

  • [[Super Company Ltd]] is the file name
  • [[Super Company Limited]] is an alias
  • [[Super Company]] is an alias

The result is that I am not getting all related notes as it is only pulling back notes where the property is the file name [[Super Company Ltd]]

Is there a way to find all related notes irrespective of whether the file name or alias has been linked?

I believe you can write something like:

TABLE current-org, current-role
FROM “Z”
WHERE current-org = “[[Super Company Ltd ]]” OR contains(file.aliases, “[[Super Company Ltd]]”

I tried what I thought was a similar example and it seemed to work. YMMV

p.s. if you really mean file name, then “current-org” should be file.name