Some help with Dataview for "unified" tasks & notes on both desktop and mobile?

But it’s exactly this what the expression !Completed AND !Due AND !Priority does.
All the conditions need to be accomplished (if all ok, then TRUE). If at least one is FALSE then all the filter is FALSE.

I may be somehow unable to understand the logic behind this, but the way I (still) perceive it, the following…:

WHERE !Due AND !due AND !Priority AND !priority AND !Completed AND !completed

…should translate in English to:

WHERE Due AND due AND Priority AND priority AND Completed AND completed ALL aren't set to some value

And yet, if only ONE of them has a value, the filter works. That’s why I asked in the reply where I mentioned I found the solution that I’m wondering how do you test precisely that, if more than one values are set at the same time, if this filter works with only one of them being set.

Hmmm… I’ll have to test this out - I don’t have the time to do it currently (or I’ll fall again in a rabbit hole of testing, end up spending the rest of the day trying to make my “organizing system” work, and do zero work). I’ll try it out later and get back to you.

However, it seems close to my initial approach that was supposed to do precisely that and didn’t work for me:

WHERE !completed AND (!due = "" OR !priority = "")

…that I mentioned in my OP. From a logical standpoint it should work.

Sorry but i don’t understand. In the current filter ALL the conditions need to be TRUE (if ONE false, then all the filter is false). Now you want to know how create a filter with the condition that all the filter is FALSE only if at least two conditions are false? If that’s the case, then I don’t know how to answer.

BTW, your previous filter has more logic if write in this way:

WHERE (!Completed OR !completed) AND (!Priority OR !priority) AND (!Due OR !due)

Precisely, as I stated in my previous reply, and the way I perceive it, the current query…

WHERE !Due AND !due AND !Priority AND !priority AND !Completed AND !completed

…should work if ALL of those values aren’t set to something, right? And yet, it works when only ONE of those values is set. Or more. Which is what I was trying to do with this particular query.

As in, I have a note where all values are blank. It shows up among the query’s results. As soon as at least ONE of those values, Completed, Due, or Priority are populated with something, the note disappears from the query’s results.

As I said in my previous reply, I can’t understand why it didn’t work with “OR” but needed “AND”. If I typed my query in plain English, I want the page to appear in the query’s results…

WHERE Due isn't set, OR Completed isn't set, OR Priority isn't set, blah-blah-blah

…and yet that didn’t work. What did was…

WHERE Due isn't set AND Completed isn't set AND Priority isn't set

…which in English should mean that, for the note to disappear from the query’s results, ALL those values should not be set. Right?

Let’s look at it another way: it’s as if I had a “White:” and a “Black:” parameter, and I wanted a query to show a note with those values if either White OR Black weren’t set to a value. Notice the “OR” in the sentence. This should work if at least one of them was set to a value. That should give me a query like…:

WHERE !Black OR !White

And yet, that didn’t work, but…

WHERE !Black AND !White

…did. However, this last query above “reads” in plain English as “BOTH of those parameters SHOULDN’T be set”. And yet it works if only ONE of them isn’t set.

Not sure I know enough about Dataview, but it seems to follow first-order logic, no? Which can be a bit counter-intuitive at times.
Not-(A OR B OR C) is equivalent to (Not-A) AND (Not-B) AND (Not-C).
In other words, you can’t just “distribute” the “Not’s” across a string of conjunction or disjunction.

1 Like

Yes, close to, but not the same. :slight_smile:
I have further nesting as I figured you had missed a condition in your descriptive text here (on the forum) compared to the code you provided. Even your example in your reply in reality “only” tests for !completed and ONE of either !due or !priority (but not both), whereas mine is testing for both. My brackets are “nested” (so to speak), which is why there are no less than 4 closing brackets.

I also see that I tested “Completed” for anything that isn’t “Yes” (note the != as opposed to !Completed, which merely tests for if Completed has a, any, value).

But yeah, test it when you get the time. Would be interesting to hear if it works out.

Please think only in “True” and “False”. In your last example:

WHERE !Black OR !White

WHERE - " Filter pages on fields. Only pages where the clause evaluates to true will be yielded."
The clauses are: not black OR not white. You don’t need two “true” to WHERE be TRUE. You only need to have one “true”.
TRUE (true or true)
TRUE (false or true)
TRUE (true or false)
FALSE (false or false)

WHERE !Black AND !White

WHERE - is TRUE when the clause is true
The clauses are: not black AND not white. You need two “true” to WHERE be TRUE. If any of them aren’t “true”, then WHERE is FALSE.
TRUE (true and true)
FALSE (true and false)
FALSE (false and true)
FALSE (false and false)

Exactly.

WHERE !(Completed OR Priority OR Due) = WHERE !Completed AND !Priority AND !Due

1 Like

Aaargh, just when I feel I made sense of it…

I just tried your suggestion, always keeping the same front matter on the page. Just to ensure I’ve understood your suggestion, thanks to your nested approach, the query you offered should test…

  1. If Completed is set to anything apart from “Yes”
  2. If Priority isn’t set, or isn’t empty, AND…
  3. …if Due isn’t set, or is set to a date after 2021-10-11.

…with the last two being “bundled together”, right?

Here are the results, when adding a value to only ONE of them (as in, the page’s meta front matter has ONLY a tag, based on which we filter, and ONE of the following values set):

  • Due works as you intended.
  • Completed works as you intended.
  • Priority is fully ignored.

With that last bit I mean that no matter if Priority has or hasn’t any value, the page still appears among the query’s results. Should that happen?

Apart from my reply to @Hellquist , I should also thank everyone else who’s tried to help up to now - and especially @mnvwvnm , who’s probably spent a significant time trying to help and troubleshoot my problems.

I might not yet be precisely where I want, but I’m grateful for all your help, everyone.

Probably not, no. Actually, when thinking about this earlier today I started thinking “what are we doing again?” so I had to go back up to your first post to refresh myself on what we were actually aiming for.

My first suggestion probably overdid it. I thought you wished for a list that showed projects that were overdue, and thus compared it to a date etc. In your OP you are however saying you merely wish to figure out, and list, which projects that haven’t been completely filled in. Is that still correct?

Therefore I did another take on it. I also created a table for testing/showing me what data that was read. The left column is where I tweak query, the middle column is the results (a table followed by a list, you only asked for a list, but the table was good for highlighting and testing) and the right column contains my two test files.

In there you can see both files are now being listed, for different reasons. Both being incomplete in different ways. We are only listing projects that aren’t Completed, and one of the files is listed for lacking due date (regardless of what todays date is) and the other is listed for lacking a priority. Is this what we are aiming for?

This is the list code (for copy/paste pleasure):

List
From #people/mary
WHERE ((Completed != "Yes") AND (!Priority OR !Due))
SORT Due, Priority, Status, file.mtime desc

This is the table code if you wish to use it for testing:

Table Completed as "Completed", Priority as "Prio", Due as "Due"
From #people/mary
WHERE ((Completed != "Yes") AND (!Priority OR !Due))
SORT Due, Priority, Status, file.mtime desc

Are we getting closer? :slight_smile:

Almost. I think I’ll have to explain what I’m trying to achieve by also talking about the stuff apart from this query. Maybe there’s a better way to do things. So…

The Setup

I’m trying to use Obsidian as a hybrid for both note-taking AND task management. I don’t have project notes up to now, since I’m basically trying to organize my freelance writing gigs through this, in a “unified” setup. This way I’ll be able to tackle my tasks, time-manage my day, but also actually work on each task (since they’re basically articles, and Markdown’s great for that).

This means that I might have some tasks I have to do on a particular day, but also some notes that I’d have to check that day. Thus, I decided to use common front matter in both, and have both tasks and notes with due dates, priorities, and a Completed value (among other stuff).

Until recently I wasn’t using YAML front matter, and my “task management” was basically manually copying and pasting tasks from one day to another. Then, I decided I’d do it properly. I’ve went through all my notes and added some front matter values for better organization.

With front matter (theoretically) set up, I turned my attention to a) upgrading my daily notes to “pull” by tag and date everything I’d have to do each day, and b) create a dashboard where the rest of the tasks would appear, and embed it after the “primary task section” of each daily note. That’s where we’re currently at.

In my daily notes I have the following (note: I’m using “`` `” typed wrong intentionally, or it marks the blocks as code here as well):

### ⬜ Tasks
`` `dataview
TASK
FROM ""
WHERE (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (due=date(today) OR Due=date(today))
`` ` 

### 🗒 Notes
`` `dataview
LIST
WHERE (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (due=date(today) OR Due=date(today))
`` `

In the separate “tasks dashboard note” that I’m trying to create, I have separate sections for tasks that are:

Overdue

`` `dataview
TASK
FROM #tasks
WHERE (due < date(today)) OR (Due < date(today)) AND (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (due !=null) OR (Due !=null)
`` `
`` `dataview
LIST
WHERE (due < date(today)) OR (Due < date(today)) AND (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (due !=null) OR (Due !=null)
`` `

Upcoming

`` `dataview
TASK
FROM #tasks
WHERE (due > date(today)) OR (Due > date(today)) AND (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes"))
`` `
`` `dataview
LIST
WHERE (due > date(today)) OR (Due > date(today)) AND (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes"))
`` `

Priority: High

## 🟥 Priority: High
`` `dataview
TASK
FROM #tasks
WHERE (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND ((Priority = "High") OR (Priority = "high") OR (Priority = "hi") OR (Priority = 3))
`` `
`` `dataview
LIST
WHERE (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (Priority = "High") OR (Priority = "high") OR (Priority = "hi") OR (Priority = 3)
`` `

### Priorities: Medium and Low
Same as the above, with a simple word swap. Or two. Because, as I realized, the YAML and dataview queries combo is case-sensitive, and I want catch-all rules for when I absent-mindedly (or because I can't see crap without my glasses anymore) type "Completed" with a lowercase "c" when typing on my smartphone. Yay for shared Vaults between desktop and mobile.

## And we're at...
...the point where I'm tweaking and re-checking everything, while also trying to create four extra queries:

One should show "the rest of tasks" (but not notes, or it would list my whole vault). It currently looks like:

`dataview TASK FROM #tasks WHERE (!completed OR (Completed="No") OR (Completed="") AND !(Completed="Yes")) AND (!priority OR !Priority OR !due OR !Due) `


...because I haven't yet reached the point where I can filter-out the results from the previous queries, so, there's lots of repetition.

But also trying to create three more queries, about which this post is about, where I'm trying to list tasks and notes **not** listed with the queries above, based on the tags I'm using for particular people. So, they should show tasks and notes from, say, #people/mary, but NOT if those notes already appear under my Today or High/Medium/Low priority queries.

I think this should all make more sense now - while also make you wonder WTF I'm doing and why I'm not using X, Y, or Z better approach I probably don't know about :smiley:
1 Like

By the way, with “Almost” I didn’t mean “your solution is ALMOST what I wanted, but not there yet”, for I think it’s precisely what I was trying to achieve.

Instead, I meant “Nope, that’s almost what I’m trying to achieve, but I think your approach works even better”.

I also don’t mind tables :slight_smile:

1 Like

Haha, yes, I see. No, I personally have no strong opinions on how people have their stuff set up, I have yet to reach my first month of using Obsidian. I myself basically hang here in the forums to learn from the cleverness of others who have been at it for longer. :slight_smile:

I have a similar basic use case as yours in that I am trying to use Obsidian for both notes and tasks though. Currently my “todo” setup is based around my daily/weekly notes, which both are templated and automated from the Calendar → Templater plugins.

My daily note is also pulling in a pre-set schedule (a template within the template so to speak) for that weekday, and I’ve made that schedule look like a task list where I can check things off as I get to them. I also adjust the timings of that schedule as the day goes by, so I can go back during my weekly reviews and see if the scheduled time should be adjusted permanently or not.

Underneath that first basic/rough list of daily things my “Tasks” (literally from the plugin Tasks) comes listed. It works quite similarly to Dataview in that it has its own code-blocks.

On my daily note I have it listing:

  • Overdue tasks
  • Tasks for today
  • Tasks within the next 7 days
  • Tasks with no due dates
  • Tasks done today

It goes on with adding a notes section for “Personal” and “Work” and finally it lists, via Dataview, all files I have created on that day, regardless of what type of file it is (note, bookmark etc).

Also the daily file, as all my files, have decently extensive YAML section as I use it for my habit tracking too, which gets consolidated into a weekly/monthly summary in other files.

I shall not bore you with too much details on my setup, but I can say that the Tasks plugin has both pros/cons. I can’t “set” a time for when a task should be done, only a date. Also it has a quite strict formula on how a task should be formatted (for which the modal popup helps a lot). Tasks (the plugin) doesn’t have things like “Priority” though.

On the other hand it is great for recurring tasks, and I am using it for highlighting when subscriptions renew etc. When I check one of those recurring tasks it “goes away” from my current list views but will come back the next week/month/year or whatever the recurrence is, without me having to create a new separate task for that week/month/year, which is really handy.

I’m always looking for new/different ways of doing things though, which is how I ended up seeing this thread, over the last few weeks my setup has changed almost daily but I am now down to weekly, as it slowly is setting itself. :slight_smile:

Our setups are quite similar, but halfway through, I’ve decided to skip the Tasks plugin. I don’t remember precisely “which one it was”, for I’ve also tried TQ, but both expected me to create tasks within Obsidian. At least, that was the optimal way to use them.

However, that means that if I’m reading something in Firefox, and I decide to create a related task, I have to switch to Obsidian to do that. And since I’m absent-minded (and I guess I also have ADHD), if that happens, I’ll forget anything about the task, because LOOK, UPCOMING TASKS, MORE NOTES, AND SOME IMAGES OF KITTENS! How cute!

So, I’ve created a streamlined note-taking window with AutoHotKey, that appears at the press of a button and saves anything I type into it as a plaintext file. Which is compatible with Markdown. So, if I use Markdown, and save it as “.md”, it’s Markdown. So, Markdown.

This last bit was complicated because I wanted to make it clear that I’m no dev, I haven’t created “a Markdown editor”, but just a window that pops-up and dumps everything you’ve typed into a plaintext file when you click on a Save button. It’s different than, say, proclaiming “I’m the main coder of Typora” or something :smiley:

Thing is, when I decided to also tackle task management with Obsidian, I’ve extended this solution “to also handle tasks”. Sounds impressive, right? What it means is that “I’ve added three damn buttons which add YAML front matter on top of that window, turning the TXT dumps into what Obsidian recognizes as different types of data”. Thanks, Obsidian, for making me look smarter than I am!

So, in my current workflow, to add a task to Obsidian I hit Windows Key + `, click a button to choose the type of entry I want, type something, and click save. Or, instead of clicking, use shortcuts, for even zippier entries.

Thus, long story short, I don’t have to visit Obsidian for taking a quick note or adding a simple task, and I keep it minimized when I’m researching stuff I’d like (or have) to write about. However, thanks to this AHK contraption of mine, I can still take notes and add tasks without “leaving” my browser, to… Ooh! Notes with kitten images! Thanks, brain!

And that’s why I’m trying to create a dashboard that will “take” all those “dumped files” and, through tags and YAML front matter, “make sense” of them.

I guess that explains even more about my approach.

What do you mean “I’m over-complicating things”?

Wait, I’m hearing sirens. Did you… contact… The Institute?

No, I’m not going back! Never! My approach shall work! IT WILL! IT ALREADY DOES! Almost! NOooOoOoo!

1 Like

Hehe. :slight_smile:

Good tip regarding AutoHotKey as well. I’m normally on Mac/Linux when given an option, but will be getting a Windows machine for work soon. I bookmarked the software via MarkDownload extension in Firefox, which I have formatted to save bookmarks incl YAML front-matter just as I need it.

When on my Mac or on my iOS devices I otherwise use Drafts (app/software) for similar purpose: Open it, write stuff, click button to automatically create and format notes for later sorting in Obsidian, where it will land in my inbox for later refiling/sorting.

Macs… Pfff…

I’ve always been a geek, and us “retro-geeks” always hated Macs. I mean… Why pay a premium to a company that sells you shiny products that Just Work As They’Re Supposed To, when you could get the parts for an alternative at 70% the cost, (learn how to properly) assemble it yourself (and then troubleshoot it), then configure everything to work precisely as you would like (if possible), by merely (hopefully, fingers crossed) investing one extra week (or month) of your time?

Pff… Macs… :stuck_out_tongue:

Do tell, though: how have you “configured this MarkDownload thingy”? I tried it out on and off for around a week, without changing ANY settings, and after one or two browser (or extension, didn’t notice) updates, it basically broke on me, and I’ve uninstalled it. I am using a "Nightly* version of Firefox, though, because I also like fooling myself that “I know how to develop sites” (something I’ve done once or twice around a decade ago).

Hehe, my informal title at most jobs for a long time was “Chief Geek” (official title at the time was “Technology Manager” or “Technology Director”), so I wouldn’t agree on lumping together all geeks in to that. I too would like to think I am fairly decent at web site building, it has after all been one of my main tasks since -93, working at international web agencies. :slight_smile:

Macs not only have some excellent design/music-creation tools that aren’t available on Win, but more importantly they have great command-line tools, like all Linux flavours do too. Win is getting there on the cmd-line front, but for the longest time they only had subpar cmd-line. I mean, on the topic of “shiny and just works”, that has really never been my driver, but the other way around, give me a good command-line and I can really control my shit. Can’t argue with the pricing though, its just bonkers compared to my home-built Win machines (admittedly neither of them are currently running though, but we built a shiny new PC for my son a couple of months ago, it wouldn’t look out of place in any modern Star Trek scene).

Yeah, MarkDownload is working great for me. I decided, in general, on a naming schema for all my files in my vault, which basically starts with a letter (to indicate type of file) followed by UID (a la Zettelkasten) followed by title of file (which then gets set as an alias as well). MarkDownload adheres to that format well.

Thus my naming of my bookmarks, which is the first configurable field, looks like this: B.{date:YYYYMMDDHHmm} - {title}

Next field in the configuration is where to save. It will only save to a folder within the “Downloads” folder, so I created a symbolic link to my Obsidian bookmarks folder. This means I simply have bookmarks/ in the save field. In my setup all my files get automatically created in an “inbox” folder (old habit I guess) except for bookmarks, of which I have lots, which have their own folder.

The interesting part happens in the front-matter template field, where I have this:

uid: {date:YYYYMMDDHHmm}
tags: [{date:YYYYMMDD} {date:YYYY}-W{date:WW} {date:YYYY}-{date:MM} type/bookmark {keywords}]
aliases: [{pageTitle}]
source: [{baseURI}]
author: {byline}
priority: none
status: filed
activity: toreview, articlefodder
topic:
type: bookmark
---

# {pageTitle}

[{baseURI}]({baseURI})

> ## Excerpt
> {excerpt}

---

As you can see I have set a couple of things to “sensible” defaults in case I don’t have time to edit stuff, or complete the bookmarking with making a note about the bookmark, but I can obviously go in and edit any/all things at time of saving (or, of course, afterwards too).

Just to ensure I can find a bookmark (or any file for that matter) I have, as previously mentioned, added a “Files created today” list on my Daily note and I also have a “Files created this week” on my Weekly note, for the event that I haven’t linked any other note to it at time of creation, which is actually my most common thing: create a note with my thoughts on the link immediately, which usually puts it in context immediately.

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