Why my sort is inoperate?

Hello the Dataview experts,
I am a newbee sorry…
In my database, my notes contains a “field” as metadata, this “field” could contain some items, I want to sort the 5 items that occure the most frequently.
“field” could be keyword in my case.
Here is my query:

table without id Field, length(rows) as count
WHERE field
flatten field
group by field
sort count desc
limit 5

solution by dovos operating
TABLE length(rows)
Where field
FLATTEN field as F
Group By F as G
SORT length(G) desc

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