Hi all.
Anybody can help to do a query to collect all the TODO scheduled for THIS WEEK? I know I can use the next 7 days, but I would like to see the task for this week (from Monday to Sunday).
Is it possible also for THIS MONTH?
Thanks in advance
Hi all.
Anybody can help to do a query to collect all the TODO scheduled for THIS WEEK? I know I can use the next 7 days, but I would like to see the task for this week (from Monday to Sunday).
Is it possible also for THIS MONTH?
Thanks in advance
Hi,
I thought there was a topic on this but I can’t find it
So we have no idea what week it is in the advanced query language. So there is no way to get a strict week out of it.
We can do months though! Here’s an example of that.
#+BEGIN_QUERY
{:title [:h3 "Tasks this month"]
:inputs [:today]
:query [:find (pull ?b [*])
:in $ ?today
:where
[?b :block/marker ?m]
[(contains? #{"TODO" "LATER"} ?m)]
[?b :block/scheduled ?d]
[(str ?today) ?strday]
[(subs ?strday 0 6) ?jm]
[(str ?jm "01") ?strstart]
[(* ?strstart 1) ?start]
[(str ?jm "31") ?strend]
[(* ?strend 1) ?end]
[(<= ?start ?d ?end)]
]
}
#+END_QUERY
Thanks as usual.
I got excited when I found +1w or +0W thinking could be next and this week, but it is not the case
I hope in the future they will add something for the week
@Siferiax one more thing how to add bold or highlight on the title of the advance query?
:title [:h3 "Tasks this month"]
Bold: :title [:b "Tasks this month"]
Highlight: :title [:mark "Tasks this month"]
Both: :title [:b [:mark "Tasks this month"]]
Found the topic:
Thanks @Siferiax
I used it, but I got an error:
Query for unknown vars: [?b]
is it working for you?
Working now! there was two *somewhere.
Hi all. Is there a way to make the Todo scheduled appear only after the date and time is overdue? I know how to do only date, what about time?
Unfortunately no. Time is not stored as an attribute and so is just plain text in the block content.
Likewise the only input we have for current time is an epoch timestamp and not plain text.
I feel the scheduled/deadline implementation is very lacking in that sense.
Should be a feature request to make the time an attribute in the form of epoch timestamp as well so we can more easily get the correct tasks.
thanks.
I agree that it is a pity
Hi all.
Do you know what is the syntax to have the TODO scheduled for today not recurring?
thanks
Add (not [?b :block/repeated? true])
This is an attribute that gets added specifically for repeating tasks.
Other tasks do not get a repeated false setting (not sure if never), so instead we check that they don’t have the attribute set to true specifically instead of checking they have it set to false.
Is there a way to have a table view with
| priority | Deadline | block (aka the text of the todo) | page
?
I’m trying to do this on my own with :result-transform and :view but I really cannot figure it out
Thanks for the help
Yes, here you go:
#+BEGIN_QUERY
{:title [:h3 "Custom table"]
:query [:find (pull ?b [*])
:where
[?b :block/marker "TODO"]
]
:result-transform (fn [result] result)
:view (fn [rows] [:table
[:thead [:tr
[:th "Priority"]
[:th "Deadline"]
[:th "Task"]
[:th "Page"]
] ]
[:tbody (for [r rows
:let [firstline (first (str/split-lines (get r :block/content)))]
:let [rx (re-pattern "\\[#\\w\\] ")]
:let [content (str/replace (str/replace firstline "TODO " "") rx "")]
] [:tr
[:td (get-in r [:block/priority]) ]
[:td (get-in r [:block/deadline]) ]
[:td content ]
[:td (get-in r [:block/page :block/original-name])]
])]
])
}
#+END_QUERY
Hello Siferiax.
I’ve read through all queries to try to find something I need so I can kind of adapt what I’m trying to do with tasks, but I did not find anything that is really helpful in this sense still. Perhaps a Logseq limitation?
I was going to learn datalog only so I can try to solve it myself, but this is something I need to solve as soon as possible so I can start to use this tool as it would be a perfect combination of a journal to me and a task/project management.
Okay, so this is what I’m thinking for a solution to using Logseq as a project management tool; I have it organized in a way that:
[] Fix network issues
[] Buy router
[x] WAIT Ask Angela for a quotation [at]angela SCHEDULED:<2023-10-10>
[x] Approve
[x] WAIT Angela buys it [at]angela DEADLINE:<2023-11-01>
[] Router is delivered
[] Install router
[] Configure it
First, you’ll see some “[at]name” scattered; this is to avoid mentioning members unwillingly. So, as an example, [at]siferiax should be interpreted as @Siferiax (which is what I’m really using in Logseq)
In my example above, we can assume that the subtask “Buy router” tasks can only be achieved once the sub sub task “Router is delivered” is finished, correct? Then, once the router is delivered, I’d mark it done, then mark “buy router” done and the next tasks would be “Install router” and “Configure it”. Once it is configured, the main task “Fix network issues” would then finally be completed.
Now, what I’d like to do (and that might be too complex (or not)) was to have a query that would would show only the “Router is delivered” one in my daily journal, for example. All the other ones can be ignored.
Now, let’s imagine that no tasks are ticket; the next one would be “Ask Angela for a quotation”. You can see that the tasks that has WAIT and “[at]angela” are to be considered “delegated” tasks, but the quotation one comes before “Angela buys it”. So, here, there would be other two queries:
I believe the last query is easy enough (I’ll try to do it myself), but for the other ones I believe that there is no solution… perhaps? If this can be implemented, my workflow would be golden. Thanks in advance, @Siferiax
Good afternoon and tell me how to make a request so that only tasks containing TODO [#A] are shown
Wow, this is amazing, thanks!
Now i could start to switch and using Logseq also for tasks.
Only problem is that on Android they don’t come in notifications.
Before i start to learn more about the logseq queries;
Would it be possible to have in this ‘task table’ the page title clickable to go directly to that page?
Yes, we need to make it a link
Replace
[:td (get-in r [:block/page :block/original-name])]
With the following
[:td [:a {:href
(str "#/page/" (clojure.string/replace (get-in r [:block/page :block/original-name]) "/" "%2F"))}
(get-in r [:block/page :block/original-name])]
]
Hello. This can be done with simple queries.
The [#A]
indicates priority.
{{query (and (task TODO) (priority A))}}