Dataview not listing all expected entries in table

Things I have tried

Searching google, these forums, dataview github issues etc. Can’t find a mention of anything similar anywhere.

What I’m trying to do

I have this large table:

And it’s great! However, it’s not showing all the entries, only about 2/3 of the ones I expect.
I have this list to keep track of which ones are there and which are not:

[ ] Antstorm
[ ] Applestem
[ ] Ashflower
[x] Barkpaw.
[x] Birch.
[ ] Blackjack
[ ] Blackwing
[x] Blossomstar
[x] Cedarpelt
[ ] Cherryflame
[x] Cinderkit
[x] Cinders
[ ] Cloudheart.
[x] Dawnstrike
[ ] Fallenblaze
[ ] Firewhisker
[x] Fishkit.
[ ] Flamepool
[x] Flowerpaw
[x] Foxwhisker
[x] Goldenpaw
[x] Greyfrost
[x] Hatchbelly
[x] Hazelkit
[x] Holly
[ ] Kestrelsky
[ ] Lakespring
[x] Leafkit
[x] Leopardtail
[x] Lionfrost
[x] Littlepaw
[ ] Logpelt
[x] Marshpelt
[x] Mottlespots
[x] Mouseclaw
[x] Mouseslip
[x] Muffin
[ ] Nightpaw
[ ] Oakkit
[x] Orchid
[ ] Petalkit
[x] Petalwhisker
[ ] Plumbird
[ ] Rainstar
[ ] Ravenpaw
[ ] Ripplewater
[x] River.
[x] Robin
[x] Rosepaw
[x] Rowaneye
[ ] Sandpaw
[ ] Shadow.
[ ] Shimmerpaw
[x] Shrewstar
[x] Silverkit.
[x] Silvernose
[x] Snakepaw
[x] Specklepaw
[ ] Spiderflower
[x] Splash
[x] Spottednose
[x] Stormkit
[x] Sunstar
[x] Tallhawk
[ ] Tansydapple
[x] Vixenlight

The table was generated with this dataview query:

TABLE description as Description, 
	!dead as Alive, 
	link(regexreplace(allegiance, "#allegiances/(\w+)", "$1")) as Allegiance, 
	rank as Rank, 
	mother as Mother, 
	father as Father, 
	choice(length(siblings), string(siblings), null) as Siblings, 
	mate as Mate, 
	choice(length(kits), string(kits), null) as Kits, 
	mentor as Mentor, 
	apprentice as Apprentice 
FROM "002 Projects/The Storm Underneath/Cats"
WHERE file.name != this.file.name and !contains(file.path, "999 Templates")
SORT file.name

The list was with the same, just without all the table jargon. There doesn’t seem to be any clear reason or order to them being omitted. Although, a lot more of the omitted notes link to uncreated notes, but not all of them do and not all of the ones that do that are being omitted, so I don’t think it’s related.

Hi.
Do you use yaml fields or inline fields?
Without the content/format of the fields it’s difficult to speculate about any issue.
Obviously, the first question that comes to mind is: what’s the difference in your fields between files in table and the “ignored” ones?
About your query, besides the expression with “regex” (I don’t know regex), I have some doubts about your goal with the two cases with the function choice():

choice(length(siblings), string(siblings), null) as Siblings

and 

choice(length(kits), string(kits), null) as Kits

What you want with this? The difference between files in table and the “ignored” ones isn’t in these fields? (siblings and kits)

  1. Hi, all the notes use inline fields, created from a template. If you’re interested this is it:
<%tp.file.title%>
description::
pronouns::
dead:: <% tp.file.title.contains(".")%>

Relations
mother::
father::
siblings::

mate::
kits::

allegiance::
rank::

mentor::
apprentice::

(There’s templater stuff in there too)
2. That’s the thing, there doesn’t seem to be a pattern. I’ll look through each of the fields and see how they vary between entries, but I don’t think it should matter as it’s not testing for anything other than the file name.
3. The regex is to format the tag (in the form of #allegiances/$name) to just $name as the first part is not relevant to the table.
And the choice() functions are just to display them nicely, as comma separated links or the null hyphen, instead of ugly bullet points.
And no, the table does not seem to have a bias towards these fields.

About the choice() cases, I deduce now that you use links. So, what happens if you have only one value (one link) in the fields “siblings” or “kits”?

With this format

siblings:: [[link]]

may you have a problem.

With this

siblings:: "[[link]]"

maybe it works.

just tested both of those (on one of the ignored notes) and it doesn’t make a difference

You need to isolate issues. If you are sure about the choice expression, go to a note with only one link in siblings, for example, and make an isolated test with an inline query:

`=choice(length(this.siblings), string(this.siblings), null)`

or, in your query, remove the two “columns” with choice() and check the results.

This is very interesting. I did try the table without the choice()s and it worked fine. It’s actually very similar to an issue I had earlier when I didn’t use length() in the middle of choice() and it duplicated the resulting string for each item in the list. I guess I just didn’t notice the missing entries until I had moved past that and forgotten about it.

I’m gonna try and find another way to make it look nice without using choice() then, I guess. Thanks!

Actually, upon further inspection with the inline queries (great idea), it seems length() is just error-ing out because in the notes that are ignored, at least one of those fields is only a link and not a list. Will try and force it to a list.

EDIT: yeah, adding a comma at the end of the field forces it to a list. seems good now.

1 Like

Yes, from the start I know the issue is in the length for a single link (because not an array).
But if your goal is just a nice presentation of a list of links (not per row but joined), use: join(siblings, ", ") AS Siblings

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