Been trying to create a advanced query to display my overdue tasks, but for some reason its grabbing tasks that are not scheduled and all tasks that have a due date but haven’t been completed no matter if its a due yesterday, today or a week in the future
I’ve searched the forums and watched a bunch of youtube videos, but none of the methods seem to work and there seems to have been a change in the syntax used at some point which also makes it a bit difficult to understand what does and doesn’t work anymore.
I have tried the one referenced in the docs, but no luck either…
They are all Tasks which would reside on the daily Journal pages or directly on the customer page where this query is located. All tasks may be referenced by a parent block as well.
Sample Journal page
## Scratchpad
-
-
- ## Meetings
- [[Customer B]] - Setup & Configure #SSO/EntraID #meeting
- **Participants:**
- **Topics:**
- Introductions / Agenda
- #AzureBlob - Follow-up from last week?
- How has the mount and automation with Partner A been working?
- 3 other partners on Files.com currently
- #SSO / #EntraID
- SCIM
- Next Steps
- **Blockers:**
-
- **Decisions:**
-
- **Action Items:**
- TODO [#A] Update [[Customer C]] on renewal discussions
- **Notes:**
- [files.com/Azure SSO via SAML](https://www.files.com/docs/user-accounts/sso-single-sign-on/azure-ad-sso#azure-sso-via-saml)
- ==Reminder:== Need break glass account
-
- Check-in w/ [[EL]]
collapsed:: true
-
- ## Tasks
- DONE [#B] Call [[Customer A]] at [[Organization A]] to introduce myself as their SA #call
collapsed:: true
SCHEDULED: <2024-08-19 Mon>
- No answer, left vmail
- Sent follow-up email
- DONE [#B] Call [[Customer B]] at [[Organization A]] to introduce myself as their SA #call
collapsed:: true
SCHEDULED: <2024-08-19 Mon>
- Customer answered
- Would like to understand more about the product
- Only concerns have been previously with SmartFile
- Slowness
- Disconnects
- Looking forward to meeting!
- Sent follow-up email with link to schedule meeting
- DONE [#A] Prep for meeting w/ [[Customer C]] at [[Organization B]] today at 1pm
SCHEDULED: <2024-08-19 Mon>
:LOGBOOK:
CLOCK: [2024-08-19 Mon 09:49:43]--[2024-08-19 Mon 10:04:14] => 00:14:31
:END:
- DONE [#C] Professional Development - [Datalog - Parameterized queries](https://www.learndatalogtoday.org/chapter/3)
SCHEDULED: <2024-08-19 Mon>
:LOGBOOK:
CLOCK: [2024-08-19 Mon 09:49:36]--[2024-08-19 Mon 09:49:42] => 00:00:06
CLOCK: [2024-08-19 Mon 10:04:27]--[2024-08-19 Mon 11:41:13] => 01:36:46
:END:
- TODO [#C] Professional Development - [Datalog - More Queries](https://www.learndatalogtoday.org/chapter/4)
Sample Customer Page
icon:: 🏢
tags:: Customers, myCustomers
alias:: ACME
- **Links**
[CRM](xxxxx) [+CustomerSuccess](xxxxx) [Website](https://files.com/) [LinkedIn](https://www.linkedin.com/company/xxxxx)
- **Business Use Case**
*...*
- **Partners & Technologies**
#EntraID #AzureBlob
- ### 🔎 Account Maintenance
- Migrated from SmartFile on [[2024-07-29]]
-
- ### 🎉 Increased Usage Wins
- ...
- ### 🎯 Customer Opportunities
- [[ACME/Azure SSO]] {{renderer :todomaster}}
- TODO Using SCIM?
- TODO Discuss User/Group Management
- TODO Are User Groups ready in Entra ID?
- TODO Have we replicated them in Files.com?
- TODO Do we have a break-glass user account?
- TODO Configure Entra ID SSO Integration
- TODO Validate Configuration
- [[ACME/Email Inboxes]] {{renderer :todomaster}}
collapsed:: true
- TODO Additional Discovery Needed
id:: 66bf9ef1-9c6b-416d-a36d-c8b80333ae7a
*Currently SMB customers are emailing CSV's to Account Directors whom forward it to the Data Team to manually upload into the Data Lake.*
- ✅ **DONE**
collapsed:: true
- [[ACME/Azure Blob]] {{renderer :todomaster}}
collapsed:: true
- DONE Determine Permissions Required for Azure Blob
- DONE Create Azure Blob as Remote Server & Validate
- DONE Determine & Create Mount for Azure Blob
- DONE Create Permissions Fence
- DONE Create Automation for ==Partner A==
- ### 💡 Feature Requests
-
- ### 🐞 Issue Tracking
-
- ### 🚀 Related Tasks
#+BEGIN_QUERY
{
:query (and [[ACME Corporation]] (task NOW LATER DOING TODO WAITING))
:breadcrumb-show? true
:collapsed? false
:table-view? false
:group-by-page? true
}
#+END_QUERY
- ### 🪬 Identified Features
#+BEGIN_QUERY
{
:query [:find ?name
:in $ ?current-name %
:where
[?current :block/name ?current-name]
[?meeting :block/name "meeting"]
[?root :block/refs ?current]
[?root :block/refs ?meeting]
(ancestor ?root ?b)
[?b :block/refs ?ref]
[?ref :block/properties ?props]
[(get ?props :type) ?type]
[(= ?type "feature")]
[?ref :block/original-name ?name]
]
:inputs [:current-page
[
[
[ancestor ?a ?b]
[?b :block/parent ?a]
]
[
[ancestor ?a ?b]
[?parent :block/parent ?a]
(ancestor ?parent ?b)
]
]
]
}
#+END_QUERY
- ### Notes
- ...
As far as references, I always “tag/reference” the customer organization page either in the same block as the TODO or in a parent block in the case of a meeting logged on the Journal page. TODO’s on the Customer page directly are usually part of a active or upcoming project/opportunity.
Customer pages are normal pages, no special type:: configured. People however have a page type:: person and each “person page” is also linked to their Organization via the Organization:: [[ACME Corporation]] custom property.
Whats different?
This query is hosted on a page called [[Tasks]] and should only return Tasks (TODO, DOING, LATER, WAITING) that are SCHEDULEDAND the date has PASSED.
Below is a copy of my [[Tasks]] page as well for reference.
Which version of Logseq do you use? Mine is 0.10.9 and the syntax is totally valid there. Maybe todomaster is doing something weird here? (I don’t have it installed)
Since you use SCHEDULED instead of the DEADLINE, the gist of the query should be something like
I’ve just tested the query above on your scratchpad example and it indeed returns the expected results (tasks that are not DONE and scheduled in the past).
I mistakenly assumed :block/deadline was the same as :block/scheduled and I don’t use deadline. My tasks are on my journal pages, so once I changed that it worked, beautifully.