Dataview table of all tasks and tags where task.tags contains "#elephant"

Things I have tried

I searched dataview, tags, and tasks in Obsidian Forum and found a few articles. The following were helpful and nearly what I needed. However, the queries I find seems to no longer work. Seems the syntax may have changed.

References

  1. DataView Query for task with certain tag
  2. How to create a Table of TASK depending on multiple tags
  3. How do I make a list of all tasks with a certain tag in them?
  4. Filter tasks with a certain tag

What I’m trying to do

Build a dataview that lists all tasks and tags where the tags contain “#elephant” in my daily journal note (template)—so I can reflect on them while journaling through the day.

Any community support is appreciated.

Matt

Hi all,

I’ve also tried these queries and got the following results—still not getting it:

  1. This query is close and works but lists all tags—a good starting point. I still need to figure out how to filter on tasks with tags containing “#elephant” and list all task.tags.
```dataview
TABLE WITHOUT ID (tag + "(" + length(rows.file.link) + ")") AS Tags, sort(rows.file.link) AS Files
FROM ""
WHERE file.tags
FLATTEN file.tags AS tag 
GROUP BY tag
SORT length(rows.file.link) DESC
  1. In this example, I’m trying to find how to list the tags from the task—but can’t find the right syntax. No dice—I’m not finding the right syntax to display tags.
```dataview
TABLE WITHOUT ID (tag + "(" + length(rows.file.link) + ")") AS Tags, sort(rows.file.link) AS Files, file.tags AS Taglist
FROM ""
WHERE file.tags
FLATTEN file.tags AS tag 
GROUP BY tag
SORT length(rows.file.link) DESC

Thanks in advance for the eye.

Matt

Clarifications:

  • you want a table with tasks… but you know that tasks in table are just text, not an interactive tasks with checkbox?
  • you want to see in the table the text/content of each task that contains the tag “#elephant” in his own text, not in generic page content?
  • you said «all tasks and tags where the tags contain “#elephant”» - this is not clear. besides the tag #elephant (deducing that is a tag placed in the tasks), which other tags you want to see? other tags in same task? other tags in the same file?