I have two separate entries in a file
10:55 - maintain:: Some Task
11:17 - maintain2:: Some Other Task
Is it possible to have both show in the same column?
I tried this but it does not work
table dateformat(date, "cccc") as Day, ((maintain as Task) or (maintain2 as Task))
FROM #Journal and -"zzzTemplates"
WHERE (date(today) + dur(1day)) - file.cday <= dur(7 days)
and ((maintain) or (maintain2))
sort file.name desc
If you use literally this format, you don’t have any field:
If you want to use the full-inline format (key:: value) you can’t add text before your field. You can use this format:
10:55
maintain:: Some Task
or
11:17
- maintain2:: Some Other Task
If you want to keep all the content in the same line, then you need to use the inline field in the format [key:: value] or (key:: value) (the difference in the brackets is related to the render of the field - you need to enable the inline field highlighting in settings > dataview - round brackets hides the key):
10:55 - (maintain:: Some Task)
11:17 - (maintain2:: Some Other Task)
About the query, I have some difficult to understand your goal… If you want a list of “maintain” values in each note, why you give two different key names? Why you don’t use the follow format (multiple values for same key)?
10:55 - (maintain:: Some Task)
11:17 - (maintain:: Some Other Task)
If you want to join two fields in same column you can work with list(maintain, maintain2) AS "Tasks"… but you’ll have issues when one of the values is empty; or if you want the output as a string (and not a list), you can use default(maintain, "") + ", " + default(maintain2, "") AS Tasks; or …
Note: it does work for me with text before the field e.g. like this on same line
12:19 - (bmt) maintain2:: Brush my teeth
I’m trying different keys because I want to see if I can create some reports for only some of the “maintain” items
But on one report, I would like them all in the same column.
Wait!!! This format works with you?! Are you using any special plugin that also use metadata fields?
If you use this simple js inline query (you need to enable js queries in settings > dataview):
`$=dv.span(dv.current())`
these fields are listed?
(note: with this inline query in a specific note you can see all “queryable” metadata in that note… and the structure of the metadata)
Thanks for the reply.
These dataview settings don’t have influence in the metadada. I mentioned them only to you use the inline query $=dv.span(dv.current()). It’s a useful query to check all metadata in the current file and to learn how the metadata is structured. (don’t expect a rendering of inline queries in Live Preview, only in reading view - I’m using the “old” editor legacy, so I don’t use LP)
Well, returning to the inline field, this is very strange. But if works for you… take advantage of it
As I said in my first post, that is the best option for your case (the use of brackets).
In the other cases dataview read the field key in this way:
12:19 - maintain2:: Brush my teeth - in this case dv try to read “12:19 - maintain2” as the name of the field. but the use of “:” - a prohibited symbol - creates an issue and the field name is replaced by “19 - maintain2”;
in 12:19 - (bmt) maintain2:: Brush my teeth and 12:19 - ) maintain2:: Brush my teeth dv try to read all expression before “::” as the key name, but the combined use of numbers, “:” and “(” or “)” seems to be ignored and retains the key only as “maintain2”.