# How Ticket Availability Is Calculated on the Altru Calendar

> How a Calendar Builder calendar works out tickets left: capacity minus the summed quantity from a reserved events query, and why refunds skew it.

Source: https://socialgoodsoftware.com/how-is-availability-calculated-in-calendar/
Published: 2026-07-10 · Updated: 2026-11-20

---

[How Ticket Availability Is Calculated on the Altru Calendar (video)](https://www.youtube.com/watch?v=2qsuJbCA2co)

In this video, a [Calendar Builder](https://socialgoodsoftware.com/features/calendar-builder) calendar works out availability as **capacity minus sold**. Capacity comes from the calendar’s program query, and sold is the sum of the **Quantity** column in a **reserved events query** that excludes refunded items. When a time slot shows the wrong count, refunds, partial refunds, cancellations and rescheduling are the usual reasons. The video was recorded in 2021, when Altru didn’t let the calendar query availability directly.

## How the calculation works

1. **Why it’s calculated** ([0:23](https://www.youtube.com/watch?v=2qsuJbCA2co&t=23s)). At the time, Altru didn’t offer availability as something the calendar could query, so the calendar calculated it.
2. **The calendar query** ([1:02](https://www.youtube.com/watch?v=2qsuJbCA2co&t=62s)). Outputs your program’s events where **capacity** is greater than zero and the start date is on or after today.
3. **The reserved events query** ([1:21](https://www.youtube.com/watch?v=2qsuJbCA2co&t=81s)). Returns everything sold for that program from today on that has not been refunded. It outputs **Quantity**, not availability. See [how to query reserved events in Altru](https://socialgoodsoftware.com/query-reserved-events-altru/).
4. **Capacity minus sold** ([2:08](https://www.youtube.com/watch?v=2qsuJbCA2co&t=128s)). A capacity of 100 with 50 sold gives 50 available.
5. **How sold is calculated** ([2:36](https://www.youtube.com/watch?v=2qsuJbCA2co&t=156s)). The calendar adds up every **Quantity** value the reserved events query returns for that event.

## When the count looks wrong

1. **Check refunds** ([4:16](https://www.youtube.com/watch?v=2qsuJbCA2co&t=256s)). The reserved events query filters on **Refund status** equal to 0, so refunded items go back into the pool. Removing that filter would count refunds as sold.
2. **Look for other changes** ([5:19](https://www.youtube.com/watch?v=2qsuJbCA2co&t=319s)). Partial refunds, cancellations and rescheduling can also throw off the count.
3. **Troubleshoot one slot** ([5:34](https://www.youtube.com/watch?v=2qsuJbCA2co&t=334s)). Filter both queries to one **start date** and **start time**, add up the quantities, and subtract the total from capacity. Compare that with what the calendar shows.
4. **Mark a time sold out manually** ([6:30](https://www.youtube.com/watch?v=2qsuJbCA2co&t=390s)). Set that event’s capacity to 0 in Altru and the calendar drops it.

## Common questions

### Why did the calendar calculate availability instead of reading it from Altru?

When this video was made, Altru didn’t offer availability as a query field, so the calendar subtracted sold quantity from capacity. For the current way to show tickets left, see [how to show remaining ticket availability on an Altru event calendar](https://socialgoodsoftware.com/how-to-configure-availability-in-calendar/).

### What counts as sold?

The total of the Quantity column in the reserved events query for that event date and time.

### Do refunded tickets free up space?

Yes, as long as the reserved events query keeps the refund status equals 0 filter. Refunded items are left out of sold, so they return to availability.

### How do I force a time to show sold out?

Set the event’s capacity to 0 in Altru. The calendar query only includes events with capacity greater than zero, so the time drops off.

## Video transcript

Hey, this is Rick with Social Good Software. In this short demo I’ll share how availability is calculated for your calendar.

Altru doesn’t let us query availability, so we had to come up with a workaround to capture it and keep an accurate count of how many tickets are left. We have to calculate availability manually because Altru doesn’t give us a way to query it, so let me show you how that calculation is done.

More than likely you already have a calendar query. It outputs your program’s information where the capacity is greater than zero and the start date is on or after today, for that particular program, and the output fields are all the same.

We also need a reserved events query, and this is what lets us calculate what was actually sold, because remember, capacity just gives us back a number: 100, 200, whatever capacity you’ve set. The reserved events query shows everything that has been sold. It looks at items that have not been refunded, for this program, where the start date is on or after today. As you can see, we’re not outputting availability, but we are outputting quantity.

Here’s how it works. We take capacity minus the items sold, which gives us availability. A little math example: if we have 100 and we sell 50, that gives us an availability of 50. It’s pretty simple.

Now let me show you how sold is calculated, because that’s the most interesting part. Like I said, we have no way to get availability, so we need to calculate sold in order to subtract it from capacity. The query displays each sales order and the total quantity for that item. We take every quantity the query outputs and add them up, and that gives us sold. So sold is the sum of all the quantities in that output query. It’s nothing fancy. We take the sum, call it sold, subtract it from capacity, and that gives us availability, which is what’s shown on the calendar.

Now you might be wondering: “I set this up exactly this way and I’m still seeing incorrect quantities on the calendar.” If that’s happening, more than likely it was due to a refund. A refund has to be explicitly excluded from your query. In my reserved events query I set refund status equal to zero, so it only returns what has not been refunded. If something is refunded, it goes back into the pool, which releases availability. If you want to include refunds in your availability, remove that filter, and refunds will be included in the calculation.

Refunds, partial refunds, rescheduling: a lot of the activities you do in Altru can throw off the quantity shown on the calendar. If you’re getting an incorrect quantity, the only way I know to troubleshoot it is to output a specific date with a specific time in both queries. In the first one, set start date equal to a specific date and start time equal to a specific time, and do the same in the other one. Once you’ve done that, do the math: take the sum, and capacity minus sold gives you availability. If you’re missing sales orders, it’s most likely for the reasons I mentioned: refunds, partial refunds, cancellations, rescheduling, that type of thing.

The last thing: we do have a way for you to manually override it and mark it as sold out. Go to your program and set the capacity to zero, and that automatically pulls it off. For example, if some tickets have been partially refunded, go to that event date and time and set the capacity to zero, which automatically takes it off the calendar.

Hopefully that makes sense. Again, capacity minus sold gives you availability, and sold is calculated from all the quantities your reserved events query outputs under Quantity. Once again, this is Rick from Social Good Software. If something wasn’t clearly explained or you have additional questions, go to socialgoodsoftware.com/feedback. You can give us feedback on this training or on the software. We’re always looking to improve, and we’re always happy to help.

---

Social Good Software adds modern checkouts, timed-ticketing calendars, membership portals, and digital membership cards on top of Blackbaud Altru, without replacing it. Book a 1-on-1 demo: https://socialgoodsoftware.com/demo?src=llms · Call 801-822-0183 · hello@socialgoodsoftware.com · Site summary for AI assistants: https://socialgoodsoftware.com/llms.txt
