question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support sorting tasks based on file name and task description

See original GitHub issue

It would be great if one can sort tasks based on file name and tasks, e.g., task descriptions.

This request can also be seen from the following comment and the related issue.

https://github.com/blacksmithgu/obsidian-dataview/issues/46#issuecomment-896863259

First, I may query all tasks from files within a folder with something like:

dv.taskList(dv.pages('"Daily note"')
	.file.tasks
	.where(t => !t.completed)
	)

This lists all uncompleted tasks from files within the folder Daily note. However, I am not sure how are the task files sorted. Therefore, I would like the tasks to be sorted based on the file name where they come from, e.g. Note A, Note B, Note C, etc. Each of such a note/file consists of a series of uncompleted tasks.

I tried the following options (without knowing if the syntax is correct or not 😦, however), but neither of them worked for me.

dv.taskList(dv.pages('"120-Daily note"')
	.file.tasks
	.where(t => !t.completed)
	.sort(p => p.file.name, 'asc')
	)
dv.taskList(dv.pages('"120-Daily note"')
	.file.tasks
	.where(t => !t.completed)
	.sort(t => t.file.name, 'asc')
	)

Of course, it would be great if the tasks from individual files/notes can also be somehow sorted, e.g., based on task description.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
blacksmithgucommented, Aug 13, 2021

I’m going to add a more general dv.taskGroup (or something similar) which takes in a list-of-lists, which you can use the standard data array operations on to get exactly your desiring ordering.

0reactions
jackreidcommented, Dec 13, 2022

Just wanted to voice that, like @TangentFoxy, I would like to use dataviewjs to sort my taskList by the file that they occur in but cannot find any documentation for dv.taskGroup that was supposedly added.

Specifically, I would like to replicate the functionality of this DQL using dataviewjs:

TASK
FROM #tasks
WHERE !completed
GROUP BY file.link
SORT rows.file.date ASC

The following does not impact the order when ‘desc’ is changed to ‘asc’ or vice versa:

dv.taskList(dv.pages("#note").sort(p => p.file.name, 'desc').file.tasks
.where(t => !t.completed
))

The following return an evaluation error:

dv.taskList(dv.pages("#note").file.tasks
.where(t => !t.completed
).sort(t => t.file.name, 'asc'))
dv.taskList(dv.pages("#note").file.tasks
.where(t => !t.completed
)).sort(t => t.file.name, 'asc')

Apologies if I am overlooking something obvious.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sort tasks, resources, or dates in Project desktop
Sort tasks, resources, or dates in Project desktop · Go to the Gantt Chart. · Click the arrow to the right of the...
Read more >
Sorting Tasks in List View - Wrike Help Center
Sort tasks ; Navigate to the selected folder, project, or space and switch to List view 1 . ; Click the current sorting...
Read more >
How to sort your tasks - Todoist
If you want an easier way to view your tasks, try using Todoist's sorting options. With sorting options, you'll be able to view...
Read more >
Sort tasks and resources - Microsoft Project 2019 ... - LinkedIn
Learn how to sort tasks, assignments, and resources. ... Over on the right side in the show hide section, turn off project summary...
Read more >
Filtering and Sorting Tasks – Help Center - Clio Support
Filter Options under Task Lists is limited to Practice Area or text entered in the name or description of a Task in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found