Help with constructing a dataview query to count number of times a field is non-null

Hi guys, super new to dataview, trying to construct a simple dataview query. Would appreciate if anyone can help me out here.

I want to construct a dataview query and list all notes from a specific folder that would satisfy the query. This is the design in simple language:

Each note in the folder XYZ has an inline field “Patient” that appears multiple times in the note. I want to count the number of times the field has a non-null value.

E.g., if a note has an instance of this - Patient:: Jack Smith, then it should be counted by the query.

If the count is greater than 3, then list the note.

That’s it. Can you please help me build a query on this for dataview so I can see all the notes that would satisfy the above condition ?

Is this what you mean:

TABLE  length(Patient) AS "Patients (> 3)"
FROM "XYZ"
WHERE length(Patient) > 3
SORT length(Patient) DESC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.