Dataview plugin snippet showcase

You might actually want to just create a new post in the “Help” category. When you start a new topic, you get to pick the category from there. This also helps other people quickly find solutions if their problem is similar.

2 Likes

A quick question;

Does anyone else have problems with the sort when using [[yyyy-mm-dd]] as the date field?

I have a dataview table that sorts by date but it doesn’t sort accordingly…

```dataview
table project, date, attachment
from ""
where type = "meeting"
sort datum desc
limit 50
```

Then the dates sorted looks like this (again yyyy-mm-dd):

If I remove the brackets, removing the link to my daily template, then it sorts fine but dataview adds day to the date making 2021-06-09 look like “wo 9 jun. 2021”. I don’t like that.

Does anyone else has this issue or perhaps even the solution?

2 Likes

You want to sort by “date”, but your sort command refers to “datum” - maybe that is the cause of your problem?

Wow - it works - this is all so powerful. Thank you!

To count the number of rows you could do something like this:

```dataview
LIST "There are " + length(rows.file.name) + " open issues."
WHERE issueStatus = "open" AND !contains(file.folder, "Templates")
GROUP BY issueStatus
```

22 Open Issues

3 Likes

@FiekeB and I were talking about how a recipe data collection could be set up—a great example for Dataview and DataviewJS, too.

1 Like

Ah that is a typo on this forum. I’m from the Netherlands so datum is dutch for date. I translate it here on the forum and forgot that one.

The sort by date just doesn’t sort by date for me and I wonder if anyone else has that, or the solution. :slight_smile:

Have you tried enclosing datum in date()? It might not be sorting since it’s a link and not a date.

2 Likes

Thanks, that seemed to work perfectly!

I cannot get it to reveal the image. I manage only to show a hoverable file link, when I remove !. Any idea on what might be wrong?

Has this changed since the time you posted this answer? I have multiple notes with ![[embedded#^content]] that I would like to query and render on dataview. Right now, I only get the syntax on the tables, but the embeds do not display.

Does anyone know how to query for a table that only lists the values a custom YAML field?

ie: I created a custom YAML field called “Type”. I start assigning “Type 1”, “Type2” etc to these fields and I want to keep track of different Types created.

The challenge is: I don’t need to see the file names + I don’t want to see multiple (duplicate) lines of the same Value assigned to different notes (maybe there are 100 notes that is “Type1” but I don’t need to see 100 lines in the table). I just want to see a short list of the Types that I create.

Any ideas?

I’m using external images… not obsidian assets, maybe that’s the problem.

Otherwise, here is what it looks like for me:

My book index (non-capital letters in my latest version):

TABLE subtitle, ("![coverimg|100](" + cover + ")") as cover, creator, referrer, priority, purpose, status from "Books"
where file.name != "_Book Index"
SORT file.name

Here is my book page:

# AntiFragile

cover:: https://images-na.ssl-images-amazon.com/images/I/41wd4dlgGBL._SX322_BO1,204,203,200_.jpg
creator:: Nassim Taleb
priority:: Medium
purpose:: Execution, Strategy
referrer:: CEO Summit (june 2016)
status:: To Read
subtitle:: Things That Gain from Disorder

4 Likes

Try this,

TABLE Type
FROM "" 
WHERE Type
GROUP BY Type
2 Likes

I can confirm this is an issue. I use the same for my movies database and external links work like these but internal one’s don’t.

1 Like

For images I use a field with link to local files:

preview: <img width="150px" src="file:///Users/..../image.jpg">
7 Likes

Oi oi oi! That’s indeed quite clever. It doesn’t look very nice though! And I’d be vary of hard-coding the image size.

I’ve been trying to get ![[link to image]] work and now I’m wondering if that could work with your method as well. But I’ve tried to avoid adding links like that in YAML because of issues it has with the syntax. Thanks for sharing this though. I was following your github issue regarding this as well. This is a good workaround.

1 Like

Yes, you’re right. This doesn’t look good and it’s not very ‘practical’.
But for now it’s the only way I found to use local sources.
About YAML and syntax, hmmm… I’m a newbie in all this things! I just understand the basic of html, css and no more :slight_smile:

Here is a discussion with an example where it fails. The thing is [] is an array in YAML which messes up when mixed with Wikilinks.

1 Like

Hi! Im trying to have a daview table in my meeting note with the last 3 meetings from the date of the meeting I’m taking notes…can anybody help me please…Thanks in advance