In dataview, can I change for multiple tags with the contains() function? Is there a better way to show tasks with multiple tasks than with two contains() functions?

What I’m trying to do

I have this query which only shows tasks with the tag #Obsidian-Tasks

TASK
WHERE regextest("^\d\d\d\d-\d\d-\d\d (January|February|March|April|May|June|July|August|September|October|November|December)(?!.+?sync)", file.name)
WHERE contains(list(" "), status) AND contains(tags, "#Obsidian-Tasks")
GROUP BY file.link
SORT rows[0].file.day DESC

I want to change it so it only shows tasks with two tags: #Obsidian-Tasks and #Later.

Things I have tried

I did some searching in the documentation for the phrases tag and tags as well as the page for the contains() function but didn’t find anything about this.

I’ve answered posts related to this before, and the solutions relates to combinations of map(), contains() and custom list() (in this case of your target tags).

The basic idea is to build a result list where you map each of your targeted tags using contains. This list is then fed into a function like all(), to require that all of the mapped values are truthy.

I’m going on holiday for a while, so I’m not going to provide you with a complete query, but hopefully based on previous responses and the suggestions above this able to whip something together.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.