Dataview Exclusion Code

What I’m trying to do

I’m trying to create a list of all my largest notes and exclude any notes kept in my Archive folder, which has templates, and Excalidraw notes (which are large, so they’re taking up my list of top 10 notes)

Here’s my dataview code:

TABLE round(file.size / 1024) as "File Size (kb)"
SORT file.size desc
LIMIT 10

Things I have tried

I’ve tried variations of FROM and WHERE to exclude the Archive folder to no avail.

TABLE round(file.size / 1024) as "File Size (kb)"
SORT file.size desc
LIMIT 10
FROM -"Archive"

Yields:

Dataview: Unrecognized query operation ‘negate’

TABLE round(file.size / 1024) as "File Size (kb)"
SORT file.size desc
LIMIT 10
FROM !="Archive"

Yields:

Dataview: Error:
– PARSING FAILED --------------------------------------------------

2 | SORT file.size desc
3 | LIMIT 10

4 | FROM !=“Archive”
| ^

Expected one of the following:

‘!’, ‘(’, ‘-’, ‘csv(’, ‘outgoing(’, file link, string, tag (‘#hello/stuff’)

I tried more than just these two, but nothing’s worked yet.

Thanks for your help!

Hi! :smile:
When I invalidate a folder from a search I specify FROM !"path/to/file"
May I ask you to try this designation to see if it works?

Hi Cacapon!

TABLE round(file.size / 1024) as "File Size (kb)"
SORT file.size desc
LIMIT 10
FROM !"Archive"

I tried that and I got this error:

Dataview: Unrecognized query operation ‘negate’

My ‘Archive’ folder is at the highest level in my vault. Is my formatting wrong somewhere?

Thanks for your help!

Maybe, but maybe the FROM position is lower.
How about this sentence?

TABLE round(file.size / 1024) as "File Size (kb)" 
FROM !"Archive"
SORT file.size desc 
LIMIT 10 

I hope you can solve this problem! :smile:

1 Like

That was it!! Which line the FROM was from fixed it.

Thank you!

1 Like

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