Group by unique inline values in dataview

What I’m trying to do


I have couple of files that contains inline datavview fields that are links.

section: [link1]
section: [link2]

What I’m trying to do is to have dataview table where notes are grouped by “section”. And these groups are sorted by the sum on file.size of those notes. But right now If i have multiple sections in one note, dataview groups them together. So instead of
link1 and link 2 as separate groups dataview shows link1,link2 as unified group.

How can I group by unique inline values?

I want it to be a two separate groups: link1 and link2

To start, can you share your query?
… because if you want to separate the links, what happens to file.size? sum of what? What you want to display in your table?

sum(rows.file.size) as size
from "Notes"  
GROUP by section
SORT sum(rows.file.size) desc

What I’m getting right now is that if i have for example

note 1

section: [link1]


section: [link2]


section: [link1]
section: [link2]

In Dataview table i get three groups
link1 with the size of note1
link2 with the size of note2
link1,link2 with the size of note3

What i want to get is two groups
link1 with the size of note1 + note3
link2 with the size of note2 + note3

but you want the or the from the source, i.e., from Note 1, Note 2… Or only “Links” and “Size”?

Only links and size

Links in my example are the sections of the text. I want to know how much i wrote for each section by summarizing size of notes linking to each section.

Try this

TABLE WITHOUT ID SEC AS Links, sum(rows.file.size) AS Size
FROM "Notes"
FLATTEN section as SEC
SORT sum(rows.file.size) DESC

It seems to works. Thank you!

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