ivan-lednev / obsidian-task-archiver

Archive completed tasks in your Obsidian vault (plus other org-mode-like features)
MIT License
109 stars 12 forks source link

Ability to do a negative filter #71

Closed tristil closed 9 months ago

tristil commented 9 months ago

I might be missing something. I want to filter for e.g. -#recurring

ivan-lednev commented 9 months ago

This is straight from Dataview docs:

Querying from #food and !#fastfood will only return pages that contain #food but does not contain #fastfood.

Source

Note that this works only on a 'per-file' basis. You can't filter out particular tasks this way, only files.

ivan-lednev commented 9 months ago

Fix: oops, I didn't notice you created an issue in the archiver plugin. Sorry for the confusion 😆 Please clarify where do you want this filter to work

tristil commented 9 months ago

No worries. This is what I would like

image

Where #task actually would be archived

ivan-lednev commented 9 months ago

This field accepts a regular expression. Try this:

^(?:(?!#recurring).)*$

Or with multiple tags:

^(?:(?!#recurring|#some-other).)*$
tristil commented 9 months ago

Thank you! I actually did experiment with negative lookahead but I guess I needed the approach taken here. I think I just learned something new about regexp as well. This solves my problem.