You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Queries/Grouping.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -754,6 +754,17 @@ group by function task.tags.filter( (tag) => ! tag.includes("#tag") )
754
754
755
755
- Create headings for all tags that do not contain "#tag".
756
756
757
+
```javascript
758
+
group by function \
759
+
if (task.tags.length > 0) return task.tags; \
760
+
return task.findClosestParentTask()?.tags ?? [];
761
+
```
762
+
763
+
- Group tag-less child tasks by any tags on their parent task:
764
+
- If the task has any tags on its own line, then group by those tags.
765
+
- Otherwise, look for the first parent task, and group by its tags.
766
+
- If there is no parent task, treat the tags as empty.
767
+
757
768
<!-- placeholder to force blank line after included text --><!-- endInclude -->
758
769
759
770
These are more complicated examples, which you might like to copy if you use tasks with [nested tags](https://help.obsidian.md/Editing+and+formatting/Tags#Nested+tags) and wish to group them at different tag nesting levels.
0 commit comments