Dataview plugin snippet showcase

I’m not an expert in Dataview (far from that, a very, very newbie)…
My first observation is: why you create a field (“created”) if this data is an “Implicit Field”?
I.e., as you can read in the plugin documentation, there’re some metadata implicit to each file: name, size, created date, last modified date, etc.
In your case, if you are interested in the day that you create the notes, then you just need to query the file.cday implicit metadata and forget the frontmatter entry.
Try this:

```dataview
LIST
FROM ""
WHERE file.cday = date("2021-06-24")

If you want to define your own field for created date, then you need to have some attention with the way that the plugin reads the format for date. In that case, I think you need to do this:

```dataview
LIST
FROM ""
WHERE created = date("2021-06-24")
2 Likes

can you elaborate more on the exact syntax - how to include it in dataview query?

You can try this,


TABLE Type, rows.tags
FROM "" 
WHERE Type
GROUP BY Type

The docs explain how this works better than I can.

Yeah, I couldn’t get internal links to work… good thing I don’t use them on that :stuck_out_tongue:

Some of you may find this useful. It’s a dataviewjs script for creating a markdown table from a dataview table.

2 Likes

In case you’re still looking for this answer, the implicit field files.etags should do the trick.

1 Like

Minor example

Posting here more to say a heartfelt thank you to @blacksmithgu for creating this

If there was only a choice to use 1 plugin it would be this one for me. It’s totally transformed the way I work with Obsidian

table title, system, state, created, file.mtime, update
FROM ""
WHERE year=2021 AND node="branch" AND type = "stats"
SORT status asc, system asc, title asc, year asc, month asc
2 Likes

But how do you include that in the query to produce a second column?

I added it next to the first column after a comma
image

and it does not come up with any results

I believe you’re looking for rows which you need when you use GROUP BY.

From the docs: https://blacksmithgu.github.io/obsidian-dataview/docs/query/queries#group-by

This explanation helped me: Dataview plugin snippet showcase - #93 by SkepticMystic

So you could try:

TABLE Type, rows.file.etags
FROM ""
WHERE Type
GROUP BY Type
1 Like

I’m getting a déjà vu!

Hi! I want to create something like an index of my vault. I would appreciate help here.

  1. The basic thing I want to have is a list of all links existing in the vault.
  2. It would be even better, if I can put them in a dataview table, showing also a number of occurences for each link
1 Like

i know i’m probably a total idiot for asking this but i’m new to both dataview and indexer and can’t for the life of me figure this out. if i just do the outgoing note part, i get every singl oeutgoing link from every single document in the vault. I tried this and got “dataview: could not resolve link during link lookup - does it exist?” any ideas on what i can do? i love this idea SO much.

Hello!!
I would like to ask if there is a possibility to group results by displayed field values.
For example, as in this case, i would need to group “§ Art” [[tag]] on the same row.

Obsidian forum

NOTE 1
tag1:: [[§ Art]]-[[§ Equilibrium]]-[[§ Chaos & Order]]-[[§ Yin&Yang]]-[[§ Phenomenology]]

NOTE 2
tag1:: [[§ Art]]-[[§ Creativity]]

Thanks!

First, you don’t have multiples values in your field “tag1”, but only one. I don’t know if it’s possible add multiple values in inline fields. In YAML frontmatter that is possible. You need to solve this first.

1 Like

Oooh of course!! :sweat_smile: thank you @mnvwvnm for the hint!!
Now i’m beginning to understand where lays the problem.
I was trying to fit almost everything in the dataview section ,in the body of the note ,and placing values in an array didn’t work.
I guess i’ll need to have a duplicate of all those links both in yaml and in the section for dataview…at least for now when links aren’t allowed in the yaml.

But links work in yaml!
You can add something like this:

---
keywords:
  - key 1
  - key 2
  - Key 3
links:
  - [[Note 1]]
  - [[Note 2]]
  - [[Note 3]]
---

or

---
keywords: [key 1, key 2, Key 3]
links: [[[Note 1]], [[Note 2]], [[Note 3]]]
---

Your dataview query will recognise the multiples links!

3 Likes

Hey @mnvwvnm , apologies for the delay… I’ve been down with Covid this week after attending an induction day at my new teaching job last week. Thank you for your help, the first option worked beautifully! This uber newbie really appreciates your help! :smile:

2 Likes

It was a ‘bad’ start! I hope that everything is ok.

1 Like

:sweat_smile:
Oooh now i understand!!Thank you!!!
The error was in how i set up dataview.

table  tag1
from #idea
where contains(tag1, "[[§ Philosophy of Organism]]")

I tried everything and i found that the problem was in “quote” signs.
I thought yaml couldn’t support links
I really appreciate you help @mnvwvnm!!
p.s. sorry for my wacky english,i’m italian

1 Like

Ciao. Perfetto.
Il mio inglese è anche ‘wacky’. Io sono portoghese!

EDIT:
If you want just a LIST of all the notes with the tag1 [[§ Philosophy of Organism]] your can run this query:

```dataview
LIST
FROM #idea
WHERE contains(tag1, [[§ Philosophy of Organism]])
```

If you want a TABLE isolating that tag1 and hide all the others, you can try this:

```dataview
TABLE [[§ Philosophy of Organism]] as Mytag1, rows.file.link as Notes
FROM #idea
WHERE contains(tag1, [[§ Philosophy of Organism]])
GROUP BY rows.file.link
```

Mytag1 and Notes are the titles you need to add to the columns. You can choose what you want.

1 Like