Things I have tried
TABLE WITHOUT ID
eventDate,
eventName
WHERE eventDate
Quite close but the result is a single row - I expect data as separate rows will be needed to filter the table. FLATTEN command comes into my mind.
TABLE WITHOUT ID
eventDate, eventName
FLATTEN eDate
FLATTEN eventName
WHERE eventDate
but this gives me like the product of these two columns.
TABLE WITHOUT ID
eventDate, eventName
FLATTEN dateformat(eventDate, "YYYY-MM-DD") as eDate
FLATTEN eventName
WHERE eventDate
This one is a bit better: the row contains all dates and only a single event name.
For another approach to reading the data - from CSV with dataviewjs I found:
dv.io.csv("hello.csv") => [{ column1: ..., column2: ...}, ...]
but I’m not capable to write JavaScript code that will make use of that.
Unsolved problems:
- proper flattening
- perhaps it will be needed to convert date to YYYY-MM-DD format instead of dates like:
January 21, 2022
to compare with date found in the daily note filename (e.g.2022-01-13.md
) (tried withdateformat(eventDate, "YYYY-MM-DD") as eDate
) - select only rows with date matching date from the daily note filename
What I’m trying to do
I have a file where I store data (about directories with photos grouped by event) with content like this:
[eventDate::2022-01-02]; [eventName::Birthday]
[eventDate::2022-01-07]; [eventName::Lake excursion]
[eventDate::2022-01-12]; [eventName::River]
[eventDate::2022-01-13]; [eventName::Sunrise]
[eventDate::2022-01-13]; [eventName::Sunset]
[eventDate::2022-01-16]; [eventName::Mountain Excursion]
[eventDate::2022-01-21]; [eventName::Evening at home]
If not that format, a CSV file with two columns will also work for me.
In my daily note, I would like to use dataview (or dataviewjs) query that will list photo directories related to that day. E.g. In daily note 2022-01-13.md
I would like to see the table with two rows:
eventDate | event |
---|---|
2022-01-13 | Sunrise |
2022-01-13 | Sunset |
Is it doable with dataview or I need to use dataviewjs for that?