Help for building a query (NO coder here...)

Warning: as per object I’m NOT a coder, so please forgive me if I ask something a real nerd can do in a couple of lines…

I’m studying some historical events and I took notes in some hundreds of notes. Some fake examples to give the idea: in page “Some historical events” I have 30 bullets containing things like “1939 - Starts WWII” and “1945 - End of WWII”; in page “Other historical events” I have “1942 - My father was born”.

What I would like to retrieve is a new page (or whatever I can save for later) answering this question: “What happened between [year X] and [year Y]?”. In my example, if X=1940 and Y=1945, I should only see “1945 - End of WWII” and “1942 - My father was born” and NOT “1939 - Starts WWII”.

Hoping I get the point, how can I manage this?

I don’t care to manually insert “in the code” the year(s) I’m interested, as long as I can save the query (or at least the results) in some way, meaning I don’t need something polished like “input forms/windows”, but just the output.

(Xpost in Logseq Subreddit)

I would start by marking up the years. So “[[1942]] - My father was born” or turning it into a property

  • My father was born (shift enter)
    year:: [[1942]]

Now you can go to the year page and see everything from that year. And build queries like this

{{query (or [[1939]] [[1945]]) }}

This searched through the whole graph, and once you have the data it’s early enough to figure out more complex queries to get everything and order it.


Thank you for your answer!
This sound like I have to manually process all my notes to mark all dates/years. Which is doable by using some “find-and-replace” third party app like VSCode or even textedit (I’m on macOS).

What I don’t understand (and please believe me, I really don’t) is how I can query for a range of years. In your example something like {{query (OR [[1939]] SOME_INSTRUCION_HERE [[1945]])}} should give me the very same result without writing all years from '39 to '45 (I need to lookup for events spanning over centuries, sometimes. Like “from 1580 to 1690”).

Anyway, it’s just a great start that to “figure out more complex queries”, as you said.

There’s no wait to search within a range of years as years aren’t a type of data in Logseq. So, you’d have to explicitly say in the query what years you’re looking for.

If you want more help to write queries, look at these resources: