What I’m trying to do
Most of my Obsidian notes have a frontmatter property called keys which can have values that help me search for notes.
The following set of notes shows how they look.
The values of keys reflect the topics that I’m interested in, and after awhile I want to find out what I’ve been writing about. For example, these notes show that I’m most interested in valueB, then in valueA and valueD and least of all in valueC and valueE. I can see this by counting the number of occurences of each value of the property keys.
=================================================
file: Note-00.md
---
title: Test note No 1 even though filename says No 0
keys:
- valueA
- valueB
---
# Test note No 1 even though filename says No 0
*etc.*
=================================================
file: Note-01.md
---
title: Test note No 2 even though filename says No 1
keys:
- valueB
- valueC
- valueD
---
# Test note No 2 even though filename says No 1
*etc.*
=================================================
file: Note-02.md
---
title: Test note No 3 even though filename says No 2
keys:
- valueB
- valueD
---
# Test note No 3 even though filename says No 2
*etc.*
=================================================
file: Note-03.md
---
title: Test note No 4 even though filename says No 3
keys:
- valueA
- valueE
---
# Test note No 2 even though filename says No 3
*etc.*
=================================================
What I need help with is finding a Dataview query that will find, count and sort those values:
valueB 3
valueA 2
valueD 2
valueC 1
valueE 1
Things I have tried
So far I’ve used Dataview to find the values of the keys:
TABLE WITHOUT ID keys
FROM "fm-properties-and-dataview/values-of-list-properties"
WHERE length(keys) > 0
I tried to gather all the values into one long list that I can sort, count, etc. I tried FLATTENing the list but it doesn’t even parse.
Can anyone help me?
Thanks so much!
|- ge in chapel hill, nc