What I’m trying to do
I am making a lots of skills for a game that all have mentors and students. If skill A is mentor to skill B, then skill B is a student to skill A.
It is possible to be a Mentor and Student to the same skill at the same time.
The Mentors and Students are put as a list of properties in each skill file.
What I want to do is create two dataview tables in each file. One showing all the students to the current file and one with the mentors. The tables should also be able to be copy and pasted to all the files.
Things I have tried
I have one solution but it requires all mentors and students to be filled. This makes double work cause if one is a mentor then the student relationship is already there and should not need to be added. Plus if I make a new file then I need to edit all other related files.
Here are 4 files as an example:
Axe
tags: #skill
mentor:
- “[[Close quarters combat]]”
- “[[Club]]”
- “[[Staff]]”
student:
- “[[Club]]”
Close quarters combat
tags: #skill
mentor:
student:
- “[[Axe]]”
- “[[Club]]”
- “[[Staff]]”
Club
tags: #skill
mentor:
- “[[Axe]]”
- “[[Close quarters combat]]”
- “[[Staff]]”
student:
- “[[Axe]]”
Staff
tags: #skill
mentor:
- “[[Close quarters combat]]”
student:
- “[[Axe]]”
- “[[Club]]”
And then all of the files have the following dataviews that works fine.
Mentor to:
TABLE
FROM #Skill
WHERE contains(Mentor, [[]])
Student to:
TABLE
FROM #Skill
WHERE contains(Student, [[]])
Lets say I make a new file called sword
Sword
tags: #skill
mentor:
- “[[Close quarters combat]]”
- “[[Staff]]”
student:
Now the dataviews in the sword file will be empty, but Close quarters combat and Staff will be updated. Sword does not read it’s own file.
After looking around this one gave me some insight
In the other files I just use WHERE to see if [[Sword]] exists. But from Swords perspective I would need to unpack an array of links from itself.
So far I have been unable to do this. How to go about this?
Table with:
Files containing [[XXX]] in Student.
All the files in the Mentor links from the XXX file.
No duplicates.
Table with:
Files containing [[YYY]] in Mentor.
All the files in the Student links from the YYY file.
No duplicates.