Things I have tried
I tried looking at the docs but can’t seem to find any if statements and such…
I tried WHERE but can’t figure out a way…
What I’m trying to do
I have a file that acts as a hub for my notes. Let’s call this Hub.
In the metadata is → quarter: 1
Where quarter can/will contain 1, 2, 3, or 4.
In my notes, there are 2 tags: #grade and #grade/q1 #grade/q2 etc.
With this, I want to make a LIST where it displays notes with the tag #grade/q1 if quarter = 1… or #grade/q2 if quarter = 2… so on and so forth.
Here’s what I got so far:
LIST FROM #grade/q1 AND -"Templates"
yeah… I really don’t have much progress-
Why am I doing this if I could just make a copy for each quarter?
Well, I’m going to add this for 12 different subjects for school. Frankly, if I had done the long and tedious approach, I would’ve probably gone insane.
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.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.