Sublists and DataView

Having a list like

- a
	- b
	- c
- d
	- e
		- f

and a dataview query


Table without ID
file.lists.text, 
file.lists.parent

	
FROM "test" 

I get (as expected):


a -
b 1
c 1
d -
e 4
f 5

How do i have to change my query to get only those entries which have no parent? I tried some WHERE-clauses with file.lists.parent but none of my tries worked.

Do your query report just one row in the top left? I suspect it does, and that you need to split the list(s) into their separate elements in order to achieve your goal.

So something like the following might work for you:

```dataview
TABLE WITHOUT ID item.text
FROM "test"
FLATTEN file.lists as item
WHERE !item.parent
```
1 Like

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