I want to show in my Dataview diferent kinds of notes on certain topic and then sort them by year. Problem I can’t resolve is that in some notes in have in yaml “When” and others “Year”. Is it somehow possible to show both under the same name? I want to show when and year AS year.
It would be helpful to see some more of your queries, but you could possible use a variant of the following:
FLATTEN choice(Year, Year, When) as theYear
...
SORT theYear
This would opt to use the Year if it’s defined, and if it’s not defined it would attempt to use the When. And if that’s not defined, you’d get nothing stored as theYear which in any case is the variable to use for sorting.
It could be doubled up also, in case you want to do something different for when neither is defined:
FLATTEN
choice(Year, Year,
choice(When, When, "neither is defined")) as theYear