What I’m trying to do
I would like to find a way to run a dataview query table that shows me the number of incoming links to a note, but ONLY if the files linking to this note belong to a certain ‘type’.
Context: I’m thematically analyzing survey responses for a research project using an approach similar to Axle Design’s environment. Basically, I make a new note for each survey response (in a dedicated ‘data points’ folder with frontmatter that says “type:: datapoint”). Then, I write ‘theme codes’ that apply to each response at the bottom of the note as internal links. This creates notes for each ‘code’ (in a dedicated ‘codes’ folder with frontmatter that says ‘type:: code’).
I have a dataview query that shows me a table with the code names and the # of incoming links to those codes. I need this so that I can see which ‘codes’ come up most frequently in the survey responses:
TABLE without ID file.name as “Code”, length(file.inlinks) as “Data Points”
WHERE type= “code”
SORT length(file.inlinks) DESC
Now this gives me the number of ALL incoming links to every ‘code’-type note. Thankfully, right now those links are only coming from ‘datapoints’. However, I may need to link to those ‘code’-type notes from other files (for various reasons), but that’ll inflate the ‘length(in.links)’ values in the query table. Is there a way to limit the ‘length(in.links)’ value to only count files with the ‘datapoint’ type?