I use obsidian for my Vampire: The Masquerade game, specifically to manage NPCs. each NPC gets (among other things), an ‘Affiliation’ frontmatter tag, essentially, what organisations it’s involved in. simplified view below.
type:
- Person
- TEST
Species:
- kindred
Affiliation:
test_faction: head of marketing
other_test: gimp suit maker
aliases:
tags:
- VTM
- test
I can’t get dataview to only retrieve specific nested frontmatter values when creating tables, for instance when i create a table
TABLE Affiliation.test_faction, Species, Generation
WHERE Affiliation.test_faction != null
it returns everything that has an ‘Affiliation’ frontmatter value of any sort, and displays its Affiliation.test_faction (which is nothing for basically all of them). How do I specify that I only want it to show me characters with a specific nested tag (test_faction)
Things I have tried
I’ve tried using FROM #tag and adding each organisation as a specific tag, but that doubles up on data, which i’d rather not do if possible
That’s odd. What you showed ought to work, as in: WHERE property.nestedProperty != null . Looking for the mere existence of a value should work too: WHERE property.nestedProperty.
Gave it a try, and both versions seem to work. Here, NPCs 1 and 4 should show up; NPCs 2 and 3 shouldn’t:
well that’s certainly interesting. i tried disabling all my other plugins and nothing changed, and even created a dummy vault to test it out- you’re right, it does work. now what on earth could be borking it in my main vault…
At the system-level, paths or excluded folders are sometimes to blame, but you’re getting excess results rather than too few.
To me, that elevates “local” suspects over vault configuration. You probably already looked into these; but if you haven’t, it wouldn’t hurt to:
Reduce the query to no more than TABLE WHERE Affiliation.faction (or whatever you actual property is called). Make the query the only thing in the note; don’t even have Properties above it.
Review one of the falsely returned notes in Source mode for YAML syntax, capitalization, typos. Change the note’s name to “a” and move it to the root of the vault to see if that makes a difference.
because of that, it was picking up a false positive and listing it under every Affiliation.faction. changing this to remove the list property, like so,