Help with query #3543
-
I am running into issues with a query. Much appreciate assistance
The error message was:
Possibly not all the notes has the property "up" or has anything on the property "up" |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Please paste in an example frontmatter block that I can use for testing and reply. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Initial commentsThere are two problems:
Sample dataI created a variety of test notes, with different types of value in the These are their contents: ==> 3543 - QandA - Help with query - sample 1 - Notes - has single list value.md <==
==> 3543 - QandA - Help with query - sample 2 - Notes - has two values.md <==
==> 3543 - QandA - Help with query - sample 3 - Notes - has different value.md <==
==> 3543 - QandA - Help with query - sample 4 - Notes - has empty value.md <==
==> 3543 - QandA - Help with query - sample 5 - Notes - has no property.md <==
==> 3543 - QandA - Help with query - sample 6 - Notes - has string value.md <==
Which files cause the search to fail - part 1Your query executes if I delete files 5 and 6. So these are the two (or at least, two) scenarios that the query does not handle correctly. At first sight, it looks like the query should work fine with file 5, because of this:
However, by including that in the Boolean combination, it causes all expressions to be evaluation, even if the first one fails. So I can make the query work with file 5 by changing it to this - that is, adding the check for (Note I used a hard-coded
Which files cause the search to fail - part 2The other file that causes the search to fail is file 6, which does not have an array value for You have written your search to call So you have 2 choices:
Simplifying your filtersI recommend you try to break up your long filter expression line. Each separate Tasks query line is So a query:
Can be made much more readable, and easy to reason about, like this:
Checking your logicI recommend add the following line to your query, to check your logic:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @claremacrae - much appreciate you taking the time The challenge is now that condition applies to the whole query --> With your solution I need to have two separate queries and not a single one |
Beta Was this translation helpful? Give feedback.
Looking at the documentation, I see that I have previously identified two possible approaches:
https://publish.obsidian.md/tasks/Getting+Started/Obsidian+Properties#Use+%60+project%2F...%60+tag+values
There are links in that section to explanations of the language features used - though I appreciate they may need some programming background to understand.
Again, you will need to remove the hard-coded file name from these examples.
Option 1 - works for file 5 but not 6
Change this:
to this:
Option 2 - works…