How do I count the number of data items and display inline?

I have this in a daily note:

Tickets: 37992822, 37991844, 38000617

What I’m trying to do

I want to show the number of tickets inline on the same page and also on a tickets page with column headers “Date” and No. of Tickets"

length(Tickets) should hopefully do the count for you.

length(Tickets) AS "No. of Tickets"
FROM "folderWithTheDailyNotes"

Things to consider: what does your Tickets field look like on days with 0 tickets? If it doesn’t exist at all you’ll have to change the query to check for that - Dataview won’t want to find the length of something that doesn’t exist!
If you get numbers that don’t make sense, try wrapping your Tickets field in [ ] to make sure YAML/dataview knows it is a list. e.g. Tickets: [822, 844, 617]
You can always add a column to your table to display the Tickets field itself for help investigating something odd!
Good luck!

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