You’ve got two issues in your code. First of all you need to get the links defined correctly within your properites, and secondly you need to query them correctly.
Links in properties
Put the following code in a note of its own and switch to reading or live preview:
---
alternatives:
- [[Ralph List]]
- Ralph Text
- "[[Ralph Link]]"
---
```dataview
TABLE WITHOUT ID
alternative, typeof(alternative)
WHERE file = this.file
FLATTEN alternatives as alternative
```
You should get an output resembling:
Your original definition of a “link” is actually an array of arrays, or a list of lists, which in the table is shown as the double bullet, and the typeof array
. If you look in the outlinks pane for this document, you’ll also see that only the “Ralph Link” is an actual link.
In other words, a link in the properties/frontmatter needs to be written as ""[[Your link]]"
Querying the result
If I understand your request correctly, you’ll want to list all the meetings from a given persons perspective, based upon the attendees
property:
- Direct link, aka
"[[Ralph Smith]]"
- Aliased links, aka
"[[Ralph Smith|Ralphy Smith]]"
- Full name, aka
Ralph Smith
- And aliased names, aka
Ralphy Smith
So given the attendance list below, Ralph would have quadrupled himself :
attendees:
- "[[Ralph Smith]]"
- "[[Ralph Smith|Ralphy Smith]]"
- Ralph Smith
- Ralphy Smith
So when these links are properly formatted we can compare it to the current file link, and use string matching in the other cases. So singling out the special case above, I did this query:
```dataview
TABLE WITHOUT ID attendee, typeof(attendee), status
WHERE file.name = "Quadrupled"
FLATTEN attendees as attendee
FLATTEN choice(typeof(attendee) = "link",
this.file.link = attendee,
this.person = attendee OR econtains(this.aliases, attendee)
) as status
```
Which gave me the output of:
This query split the attendees
into each attendee
, and do a check based on the type of attendee. If a link, check if it matches this persons link (I’m within the “Ralph Smith” note with this query), and if it’s a string it compares either to this.person
(which also could have been this.file.name
) or fully found within his aliases.
Generalising the query
This part I’ve not tested yet, as I’ve not built up multiple meetings, so hopefully it works.
```dataview
TABLE tags as "Tags"
FROM "Meetings"
FLATTEN any(map(attendees, (attendee) =>
choice(typeof(attendee) = "link",
this.file.link = attendee,
this.person = attendee OR econtains(this.aliases, attendee)
))) as status
WHERE status
SORT file.name DESC
```
In addition to the matching from previous query, we here use that match statement to map each of the attendees to whether they’re present or not in the current meeting. The any( ... )
then checks if any of those statuses are true, indicating that this person attended that meeting.