Replies: 3 comments 9 replies
-
Can you try reversing the where order for dvjs? |
Beta Was this translation helpful? Give feedback.
4 replies
-
You can't directly use Dataview Query expressions in DataviewJS - you need to adjust it a bit. Specifically, instead of
Use DataviewJS / JS instead:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Hi, sorry for the delay.
Unfortunately, the `dv.func.contains` version resulted in 0 results. Zero false-positives.... ;-) but also zero true-positives. haha.
If you think it would help, I can pull together a set of 3 sample data files, along with the two scripts (DV and DVJS) I'm using that generate the different results. The sample files are basically around 12 lines of meta data each.
…--
Jennifer Kyrnin
HTML Jenn
http://www.htmljenn.com/
***@***.***
***@***.***
On Mar 22, 2022, 3:58 AM -0700, AB1908 ***@***.***>, wrote:
Any meaningful difference between using dv.func.contains vs DataArray.includes?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I track projects using atomic pages for updates and collect the data into a master document using dataview. But I noticed that my dataview table had 23 entries, while my dataviewjs generated chart has 28 entries.
The code for each is as follows:
dataview table showing the relevant parts
dataviewjs variable to get the data for the chart
const pages = dv.pages('#writing and #work').where(b=> 'contains(b.projects, [[redacted]])').where(b=>b.words).sort(b=>b.dateWrote, "asc");
As far as I can tell, the dataviewjs version collects any project note written on the same day as one that has the redacted project in it.
Is this a bug or have I written the dataviewjs query wrong or ???
Thanks!
Edited to add:
I have found a DV query that will generate the exact same results as the Dvjs query, by adjusting the
where
statement:where words and projects <= "[[redacted]]"
Question
I believe what is happening in the DVJS query is it's appending the
projects
keyword with every value that is found on the corresponding pages. So if a second entity added on the same day has the [[redacted]] link in it, EVERY entity written on that day will fit that category.Beta Was this translation helpful? Give feedback.
All reactions