Dataview: Multiple instances of inline field in note, WHERE clause stops repeat instances

What I’m trying to do

I have notes with multiple inline fields which I would like listed in a dataview table query. For example, in a note I might have:

[area:: area a], [something:: some text]

[area:: area a], [something:: more text]

I would then like to:

TABLE area, something
FROM "Periodic"
WHERE area > ""

and see a table of area and something listing all entries from all notes within the date range.

If I remove the WHERE area > "" clause, it works as expected, but also lists every note whether the field is present or not.

Thanks for your suggestions!

Try maybe:

WHERE area != ""
  • Means not equal to empty string.
    Not sure DV accepts this (may render the WHERE clause useless even), I usually do DVJs.

Thanks for the reply!

Unfortunately, it still lists a note with no entries.

May I interest you in this:

What happens if it’s just

WHERE area

Will it work?

Doing WHERE area will list notes where that field is defined, and has a value.

But what you need to be aware of is that if you’ve got multiple area and something in a file, you can’t connect them to each other as long as they are in the body of your note.

If you move them into lists, you are able to maintain the connection between the two fields. If you don’t, you’ll get output listing all the values of the corresponding fields in lists for any given note having multiple of those values.

Would this work for you?

TABLE area, something
FROM "Periodic"
WHERE area OR something