Hello everyone!
I have a structure like the following:
- #Airports
type:: airports
- NYC
- JFK
- ABC - 123 > #delayed
- LaGuardia
- XYX - 000 > #landed
- London
- Heathrow
- AAA - 999 > #active
- Gatwick
- WQA - 444 > #cancel
I’d like to create a table like the following, containing the flights with tags #cancel or #delayed:
| City | Airport | Flight | Status |
|-------- |--------- |----------- |---------- |
| NYC | JFK | ABC-123 | #delayed |
| London | Gatwick | WQA - 444 | #cancel |
Any idea on how can I achieve this? So far, the only thing I can do is get every block containing #cancel or #delayed, with {{query (or [[cancel]] [[delayed]])}}
, but I am clueless on how to create an advanced query to format the results as the table.
Note: for reference, the following code works in Obsidian Dataview:
TABLE WITHOUT ID
city.text AS "City",
airport.text AS "Airport",
split(status.text, " > ")[0] AS "Stream",
split(status.text, " > ")[1] AS "Status"
FROM #Airports
FLATTEN file.lists AS city
FLATTEN city.children AS airport
FLATTEN airport.children AS status
WHERE
contains(status.text, "delayed") OR
contains(status.text, "cancel")
Thanks in advance!