title: DQL10_display_notes_where_this_quarter =>1.require this.quarter 2.FROM file.tags 3.To fiter by quarter 4.To filter by file.etags 5.To display the metadata as a table
TABLE WITHOUT ID
this.quarter AS "this_quarter",
file.etags AS "etags",
file.tags AS "tags",
subject AS "subject",
file.link AS "File"
FROM "100_Project/02_dataview/Q95_etags/Q95_test_data" AND #grade
WHERE contains(file.etags, "#grade/q" + this.quarter)
SORT file.name ASC
I think there was a misunderstanding here… but thank you for the answer any way!
I’ll try explaining it again.
The notes’ metadata contains quarter but only Hub,md actually has that. Now, note that Hub.md will only, and always will, represent a single grade (#grade)
In Hub.md =>
# other stuff
Now, why not just add quarter in the notes’ metadata and be done with it?
Because there is a possibility that these notes will be part of another group (grade in this case)
So, let’s say a note named note1.md is in #grade12/q1. If we put this data in the metadata, at some point when note1.md will be part of #grade12/q2 or even #grade13/q1, the metadata will either be overwritten or duplicated (which is inconvenient). What I’m trying to say is that it is easier and more maintainable than just adding the quarter to the metadata.
What am I trying to do with this exactly?
Hub.md contains a list of subjects.
In each subject is a list/table of all topics covered in the grade, BUT I only want it to show topics covered in a specific quarter. The quarter in Hub.md’s metadata determines which quarter to show. So, if quarter = 3 in Hub.md’s metadata, the list/table will only cover topics tagged with #grade/q3.
Considering that there are 12 subjects in my case. I’m too much of a lazy person to create a copy and edit 48 different instances.
From @justdoitcc 's solution, you could take out the line WHERE quarter and the line quarter AS "quarter" and use this.quarter instead of just quarter in the second WHERE. Assuming your query is written in the Hub, which has the quarter field, it should work.