First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.
What I’m trying to do
My tasks often involve a number of sub tasks . In my notes I would put the sub tasks under the main one, indented a level
Nope. Those are no subtasks - those are just indented tasks. Maybe it looks like it was a subtask but it’s just a new task :: indented. There is no relation to the task above.
Well if you mean an actual relation to each other, then I guess the simple answer is no. Not without a plugin. Tasks in core Obsidian are basically just checkboxes.
What I do these days is use the Kanban plugin. (There are others too.)
The kanban cards are my main “tasks” or projects. And then I turn the card into a new note. And inside those notes, I keep “subtasks”.
Then with Dataview, I collect all the tasks that are inside notes that are linked from that Kanban board. And sort by note. So I have a list of all my tasks, in a sub-relation to each card in my Kanban. I put that note in my right side pane, and pin it.
That’s just my approach, and it works for me. The downside is that I haven’t yet figured out how to also sort or filter by Kanban status.