Dataview plugin snippet showcase

Do you need “where any(rows.symptoms)” ? you have != null so that is all I think you need and also I agree with what @scholarInTraining said about the order.

1 Like

Changing the order fixed it! Thank you!

1 Like

I have
Updated: 2022-06-22 14:49:26
in the yaml frontmatter. And would like to show all notes which are “Updated” more than 2 month ago. This query only returns notes without Updated though :disappointed:

WHERE Updated <= date(today) - dur(2 month)

Any Idea?

@mbreiden It’s probably having trouble turning “Updated” into a date. The formatting for such strings is super picky. You could try replacing the space between your date and time with a T, or if your comparison doesn’t need to be so precise, you could use the DV helper function split to separate out the date part:

WHERE Updated AND date(split(Updated, " ")[0]) <= ...

I also checked for the existence of Updated first, since if Updated doesn’t exist we don’t want to try to split it!

that does work thanks… yeah I think handling dates is an issue as soon as you have different locale or formats.

I just found out that I did use the wrong syntax for the month in the dataview config. luxon/formatting.md at master · moment/luxon · GitHub but while that corrects an error in the display (month is now correctly displayed) it doesn’t change the issue which was solved by using the split

1 Like

Hello: I want to create a Dataview table in one file (“podcast sample note”) that pulls in more than one value from an inline field (“Podcasts::”) located in another note (“video sample note”). Here is the query language I have used:

When there is only one value for the “Podcasts” field in the “video sample note,” the resulting Dataview table in the “podcast sample note” displays that value–in this case, “video sample note,” as can be seen below:

However, when there is more than one value for the “Podcasts” field (when I add “podcast sample too” to the inline field)–regardless of whether the values are comma separated–the resulting Dataview table displays nothing.

Just to be clear, I don’t want the table in the “Podcast sample note” to display BOTH of those values from the “Podcasts” field in the “video sample note” (“podcast sample note” and “podcast sample too”). Instead, I want the table in the “podcast sample note” to display the name of the video file (“video sample note”) regardless of whether the video file has just one value or more than one value listed after the field (“Podcasts”).

Can anyone help me out here? Is the problem with my “annotation” or my “query”? Something else?

I’m not sure I totally understand what you are doing, but if sounds like you might want to look into the function contains.

Many thanks for the response. I took a crack at using the contains function and, after many failed attempts (par for the course when using Dataview), I believe I have gotten the results I wanted. Thanks for the suggestion.

1 Like

Can you tell me how group by works in Obsidian? I am trying to sum up my minutes of workouts each day. It seems simple enough but I am not getting the Sum correctly.

TABLE sum(rows.exercise) as WorkoutMinutes
WHERE exercise != null
GROUP BY file.name

I want to build a chart from my workout data over time but I don’t think this would work from obsidian chart data input. Please help - thank you so much :slight_smile:

Glad you got it working, Gaston!

Same here, same here. Thank goodness computers usually let us undo and retry. :slight_smile: