The first (7) characters contain the project number.
The rest of the line includes relevant project information (that will be the same every time)
I would like to use Daily Notes to keep a list of Project tasks by:
1- copy and paste the project information into a task line (from a master list)
2- add sub tasks as required/requested on that day.
3- have them listed as a Dataview (plugin) query of daily notes to create a master TO-Do List.
My Dataview query looks like this:
where contains(string(section), "TGProjectLogs")
group by description
sort description desc
1- How to sort the tasks based on the first (7) characters of the task description string.
2- How to group the subtasks based on the “main” task description.
Thank you for the descriptions and the images. I understand much better now!
Of your two reasons for not working, the first one is easy to fix. You want to replace your line that is sorting with sort text asc. Dataview uses “text” instead of “description” for the contents of the task, and you said you want ascending instead of descending. Also put your sort before your group by if you want your groups to be sorted!
Consolidating is trickier. This will get you partway to what you want: replace your line that starts “group by” with:
group by substring(text, 0, 7).
Remember, you want this after your sort!
Substring is a dataview function that doesn’t show up in the documentation page for functions (there are a couple of these! Hopefully the documentation will get updated!). If you pass it a string such as the text of your task, and then tell it where in the string to begin and end it’ll give back just the portion between the beginning and ending. Starting at 0 includes the first character, ending at 7 means stopping after the 7th character.
So this gets you headings for your project codes. Any further consolidation is complicated. If I have an idea for it, I’ll come back and edit this post, but it likely won’t be until Monday in FL that I’d have time to think about it.
That’s odd! I did test this on my vault before posting and it worked. Can you check that your Dataview plugin is up to date by going to Settings → Community Plugins → “Check for Updates” button, then Update on Dataview (or Update All) then close and re-open Obsidian? I just now had an update to Dataview when doing this process. Hopefully we will be on the same version now!
And as part of this update substring is now documented!
EDIT: @Puy I confirmed that the query, including group by substring(text, 0, 7) works for me on the latest Dataview. If it doesn’t work for you then I am really confused!
Interesting! I think I understand the problem you solved with this (my apologies for not noticing the problem before - I am still getting a hang of how dataview handles subtasks) but I don’t understand why your solution works. Yay, a learning opportunity for me! Any chance you could share a screenshot of part of the results of the working version with the group by? Thanks!