Need some help in setting up a specific dataview querie

Hello to everyone.
I need some help in setting up a specific dataview querie.
Sorry in advance for my bad english.

I would like to visualize all of my “idea” notes based on the number of connections to all of my other notes which i call [[concept notes]] (and group them by number of connections.)

Now i’m using this

TABLE file.inlinks as Backlinks, length(file.inlinks) as Total 
FROM "SlipBox" 
SORT length(file.inlinks) DESC

but i can’t get rid of notes which are tagged “reference”.i would like to see only my “idea” notes

all of my notes look somethink like this (without actualò content)

metadata

Date:: 2022-06-21T23:09
tags:: #idea
source::
link:: [[imoc - meaning]]
link:: [[MOC Nihilism]]
link:: [[MOC Meaning]]
link:: [[MOC God]]
link:: [[MOC Values]]
See_also::
Opposite::
New_field1::
New_field2::
New_field3::
up::
down::
same::

Thank you in advance

FROM "SlipBox" AND #idea ?

1 Like

Hi @mnvwvnm :slight_smile: thank you
I’ve tested,but can’t get i right.I would like to see alla of my [[MOC …]] notes ,which are internally tagged “moc”, on the left side and notes tagged “idea” on right side.practically the most popular MOC notes which are linked from note with “idea” tag
i hope i get the question right.thank you

When in your first post you said “but i can’t get rid of notes which are tagged “reference”.i would like to see only my “idea” notes” you don’t specify which notes in table. So, the first deduction is: they want to filter the “source” notes, i.e., the notes you see in first column.

I started by this query

Now I have no idea about the start point.

  • you want to filter the source notes? The notes in first column? If yes, the notes with the tag “#moc”? Maybe FROM "SlipBox" AND #moc
  • you want (also) filter the file.inlinks you see in the second column? filter only file.inlinks tagged with #idea?
1 Like


now i have this table.on the right i have notes which are tagged both “idea” and “reference” but i would like that the right column showed me only the ones with “idea” tag so i can see the most popular concept notes only for my ideas

That is a more complex thing to solve.

1 - with a “bad code” I can suggest something like this (but implies repetitions, repetitions, etc.):

TABLE
   filter(file.inlinks, (i) => contains(i.file.etags, "#idea")) AS Backlinks,
   length(filter(file.inlinks, (i) => contains(i.file.etags, "#idea"))) AS Total
...

And then I guess you need to do the same in SORT command.

2 - there’s another way, but implies a more structured understanding in how works FLATTEN and GROUP BY commands. Something like:

TABLE rows.IN AS Backlinks, length(rows) AS Total
FROM "SlipBox" AND #moc
FLATTEN file.inlinks AS IN
WHERE contains(IN.file.etags, "#idea")
GROUP BY file.link AS File
SORT length(rows) DESC
1 Like

Thank you!!! :grinning:
Works perfectly!

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