I am currently looking to filter tasks from all notes in a specific folder, based on a particular metadata, using the dataview. Previously, I had been able to achieve this by utilizing the following query successfully:
WHERE customer = "MyCustomer"
WHERE projectName = "MyProject"
GROUP BY workstream
Since the major recent update to the task feature, I would also like to exclude “NON_TASK” from my results. Unfortunately, my attempts to update the query have been unsuccessful so far.
I what I am trying to achieve is feasible and, if so, how should I proceed ?
Thank you in advance.
Here you would need to replace the list of status characters with all of your non task status characters.
Due to the increased number of available statuses in the latest task update, I would rather work with status types (such as TODO, DONE, IN_PROGRESS, CANCELLED, and NON_TASK) instead of individual statuses.
This approach would save me from having to deal with complex query updates if I were to make changes to the task status mapping in the future, considering that the query will be deployed across numerous pages.
Regarding the methodology to build the query, I have no concerns about utilizing either the built-in capabilities or the dataview.
So going back to my initial question, I tried to add my initial query a WHERE !NON_TASK but it has no effect. Still wondering what is the best way to achieve this.
So in other words: What is the best way, to query tasks from all notes in a specific folder, based on a particular metadata, and filtering on status type.
there is work on SQL queries being done. Not sure when this might get added officially, but it will allow you to do what you want and much more. It specifically supports using status name or check mark in a where clause.
Holroy’s statement is accurate. You are correct that you can query tasks in Dataview, but the “NON_TASK” status type is a feature specific to the Obsidian Tasks plug-in (note that the link you included above demonstrating the new “Status Type” is a link to Obsidian Tasks).
As mentioned by Holroy, while you cannot use the NON_TASK feature in Dataview, you can use the character from the custom statuses to build the same function into a query. For example, if you have a non-task bookmark task defined as “- [b]”, then you could filter out statuses containing “b” as Holroy described.