Hello to everyone,
I am currently trying to create a Dataview query that summarizes the most important inline fields from my daily notes on a dashboard, the Daily Hub. The problem is that the list of mood fields is also displayed on days when no corresponding entries exist. I have already experimented with choice and nonnull, but I haven’t achieved a reasonable result yet.
Things I have tried
dataview
TABLE WITHOUT ID
file.link + "<br><strong>Summary</strong>: " + summary +
"<br><strong>Mood</strong>: " + "<ul><li>" + (join(nonnull(mood), "</li><li>") + "</li></ul>") AS Items
FROM "Journal"
WHERE mood OR summary
SORT file.name DESC
LIMIT 7
As I mentioned above, I would like to show the specific inline fields only if they are present on the corresponding day.
Unfortunately, your suggestion does not lead to the desired result. For some reason, which I cannot explain, the entries are displayed twice with a “,” in between. Here is the result:
It sounds like your mood property is a list. So if you had, say, four mood items on a particular day, the query you’re using would display the full list four times. Try this with unique to avoid duplicates:
```dataview
TABLE WITHOUT ID
file.link + "<br><strong>Summary</strong>: " + summary + unique(choice(mood, "<br><strong>Mood</strong>: <ul><li>" + join(mood, "</li><li>") + "</li></ul>", "")) AS Items
FROM "Journal"
WHERE mood OR summary
SORT file.name DESC
LIMIT 7
```