Summary of Weekly "Topics" (Outgoing Links)

What I’m trying to do

I want to create a dataview list of links from my daily journal entries that are in a specific folder. Essentially, in my daily journal entries, I link to things like “people” (individual people notes in a folder called “People”) if I have had interaction with them that day. For a weekly view, I want to just create a list of unique people I interacted with for the week.

The query I’ve got so far is:

```dataview
LIST filter(file.outlinks, (o) => startswith(o.file.folder, "People"))
FROM "@Journal/Daily" 
WHERE (file.cday.weekyear = 30 AND file.cday.year = 2023)
and startswith(file.outlinks.file.folder, "People")
SORT file.outlinks.file ASC```

But this creates a list of the week’s notes (that have an outlink) as a bulleted list with a sub-bullet for each person (there are only five journal notes created for the week):

  • 20230728 Fri:
    • Person A
  • 20230724 Mon:
    • Person A
    • Person B
  • 20230725 Tue:
    • Person B
  • 20230726 Wed:
  • 20230729 Sat:
    • Person B
    • Person A

When what I want would just be:

  • Person A
  • Person B

I’ve also tried the above query with the WITHOUT ID added, but that gets me this:

    • Person A
    • Person A
    • Person B
    • Person B
    • Person B
    • Person A

I tried doing some group by (with file.cday or file.outlinks) but both just give me:

Any thoughts on how to clean up my query? Mostly I’ve pieced together what I have from other folks’ examples, so I don’t necessarily understand it all, but it’s close :slight_smile:

Thanks!

Can anyone give me any hints on what I should do or how to correct my list to make the notes listed unique?

I think you can combine FLATTEN with GROUP BY.

If you flatten the list first, then you could group by the link to just get the unique value.

Maybe this thread can help?
This post also gives an example of using flatten and group by together

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