Query for all TODOs grouped by tag?

I have been using the journal to create my todos, by creating a tagged line, and then listing todos below that. Eg:

2021-07-04
- The new light fixture arrived for the [[Garage]]
  - TODO Install new light fixture
  - TODO Move light switch closer to the door
2021-07-01
- I have upgraded [[NextCloud]], next I need to
  - TODO Add secondary media type for local backup
  - TODO Add cloud storage for remote backup of critical files
  - TODO Enable SSL 
2021-06-25
- I have ordered a new light figure for the [[Garage]] 

When I go to the [[TODO]] page I see a very wordy list of Linked References. Eg:

2021-07-04
The new light fixture arrived for the [[Garage]]
- TODO Install new light fixture
The new light fixture arrived for the [[Garage]]
- TODO Move light switch closer to the door
2021-07-01
I have upgraded [[NextCloud]], next I need to
- TODO Add secondary media type for local backup
I have upgraded [[NextCloud]], next I need to
- TODO Add cloud storage for remote backup of critical files
I have upgraded [[NextCloud]], next I need to
- TODO Enable SSL 
2021-06-25
I have ordered a new light figure for the [[Garage]] 

Is there a better way to show these with a query? I can create a query for all tasks, but any attempt to group by tag does not work. Ideally I would be able to group by tag, and then sort by priority within those groups. Eg:

Tag [[Garage]] (2 tasks)
- TODO Install new light fixture
- TODO Move light switch closer to the door
Tag [[NextCloud]] (3 tasks)
- TODO Add secondary media type for local backup
- TODO Add cloud storage for remote backup of critical files
- TODO Enable SSL 

Before LogSec I did this manually, using this extension for VSCode, which worked really well. But it required direct manipulation of the file, so if it wasn’t on that page it was never seen, and when on the actual information page for the project it wasn’t seen there either. Todo+ - Visual Studio Marketplace

Or, if there is a better way for project management please point me to the reference/guide/video.

I do this:

{{query (and (todo now doing) [[imp-urg]])}}

The [[imp-urg]] part is a tag that I use as a sort of contextual prioritization technique, so the I use the same query but with other tags lower on the page.

I also change the now doing part to later todo for prioritization purposes. Could also just use todo without those parts to show everything.

2 Likes

Thank you. I struggle with the search terms a lot, it seems overly complex, and I don’t know if my search is wrong or LogSeq is broken. Based on yours for the Priorites TODO [#A] Test task I’ve gone with

{{query (and (todo todo) [[A]])}}