Is sorting tasks by priority and task indentation incompatible?

Hi everyone,

I am relatively new to Obsidian (been using it for about a month). I have a few projects I am working on, with tasks on some hub notes for each, and I needed a central note where I could see what is pending all over my vault, and I was doing this purely on DataView. I found the Tasks plugin and started using the dates and priorities.

What I want to do is to query to show all the tasks in my vault (except for the note where the query is made) that are not yet performed (not checked), that are, for example, scheduled for today or before, grouped by the file where the task is located, and within those, sorted by priority, and preserving the indentation of subtasks.

The first thing I tried was doing it with DataView, and do something like this (this is a dataview query, the dataview after the reverse quotes is not shown).

TASK
WHERE !completed 
	AND !checked 
	AND date(scheduled) != null
	AND scheduled <= date(today)
	AND file != this.file
GROUP BY file.name
SORT BY priority 

It did not work. If I remove the last line, it works, but the tasks within each group are not sorted as I wanted them. I thought the problem was the interaction between the grouping and the sorting, but removing the grouping command and just sorting it gives me a syntax error too.

Then I saw that the Tasks plugin has its own type of query, so I tried this (This is a tasks query, same thing as previous code block)

NOT done 
GROUP BY function task.file.filename
SCHEDULED ON OR BEFORE today
SORT BY priority 

It does pretty much everything I want except it flattens the list of tasks. And I did not find a way to exclude the current file without using something like FILTER BY function ! task.file.filename.includes("ActualPartOfThisFileName").

So, my questions:

  1. Is there a way to sort the groups by the priority icons that the Tasks plugin uses, but querying directly with DataView?
  2. If the answer to the previous question is ‘no’, is there a way to present the Tasks queries unflattened (showing indentation for subtasks)?

I hope I was able to explain myself. Thanks for any help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.