I have a YAML property called keywords which takes one or more values. For example:
---
title: Scientific instruments both correct and discipline the senses
keywords:
- bodies
- bodies and science
- scientific instruments
---
I want to get a list of all the keywords used and the number of times they have been used. I have the following query which goes most of the way, but it’s still returning things like “bodies, bodies and science, scientific instruments” as a single keyword. Obviously a problem with the GROUP BY but I’m not sure where to go from here
TABLE
length(rows.file.name) as Count
FLATTEN keywords as Keyword
GROUP BY join(keywords, ", ")
I’m still new to dataview, so I can’t answer with your example, but this is working for me:
TABLE WITHOUT ID City AS "City", length(rows) AS "Occurrences"
FROM "Running/Journal/2024/01. Daily"
FLATTEN City
WHERE DateTime >= date(this.startDate) and DateTime < date(this.endDate) + dur(1 day)
GROUP BY City
SORT length(rows) DESC
… and this is a table that I got:
I hope you find it helpful and it can help you with your challenge.