Gift card balances on a past date
This report identifies which gift cards were active on a selected date and approximates their remaining balance at that time. It is most useful when reconciling gift card liabilities, preparing historical financial statements, or reviewing gift card activity for a previous period.
π‘ Shopify does not expose historical gift card balance data to external apps. This report approximates balances using transaction data and issued, expired, and disabled dates β it is not a direct record of balances at a point in time. For a more reliable historical record, schedule the built-in Active gift cards report to deliver to email or Google Sheets at a set frequency, such as the first day of each month.
In this article
- How the report works
- Steps to build the report
- Interpreting the results
- Variations and extensions
- Need more support?
How the report works
The report is built on the Gift cards primary table, where each row represents a gift card issued through Shopifyβs native gift card functionality. This is the correct table for this analysis as it contains the gift card-level fields β initial value, issued at, expires on, and disabled at dates β needed to reconstruct each card's status and balance at a point in time.
Three custom parameterised fields are required β all three use the same @Date parameter so the selected date is applied consistently across the report:
- Amount spent up to @Date: the Gift cards table only records the total amount redeemed as of today, not at a point in the past. This field sums all gift card transactions up to and including the selected date to reconstruct the amount spent by that point.
- Balance on @Date: approximates the gift card's balance on the selected date by subtracting the Amount spent up to @Date from the gift card's initial value. Gift cards issued after the selected date return a balance of zero.
- Gift card active on @Date: returns
Truefor gift cards that were issued on or before the selected date and had not yet expired or been disabled at that date. Used as a filter to scope the report to cards that were active at the point in time being reviewed.
The report is filtered to show only gift cards that were active on the selected date and had a remaining balance greater than zero at that time.
π‘ Store credit issued via Shopifyβs native store credit feature is not included in this report. These are not surfaced through the Gift cards table that this report is built on.
Steps to build the report
π‘ Prefer to skip the setup? If you'd like this report built for you, contact our team through the Help widget in the bottom-right corner. We typically respond within one business day.
Step 1 β Create the report
To create a new blank report on the Gift cards primary table:
- Open the Explore tab
- Select the Primary table selector above the Available fields pane
- Select Gift cards to change the primary table
Step 2 β Create the Amount spent up to @Date custom dimension
This custom dimension sums all gift card transactions up to and including the selected date, returning one total per gift card. A subquery is required because the Gift cards table **only records the total amount redeemed as of today β the transaction-level data needed to reconstruct a historical total lives on the related Transactions table, joined at the gift card id level.
- Select Edit, then + Create new, then Create Dimension
- Set the Primary table to GiftCard
- Set the Display name to Amount spent up to {@Date}
- Set the Description to Sums transaction amounts for a gift card id up to and including the selected date
- Set the Data type to Number and the Numeric type to Currency
- Select + Add parameter and configure the
@Dateparameter as follows:
π‘ All three custom fields in this report use the same @Date parameter configuration. Configure it as follows in this step β Steps 3 and 4 will reference these same settings.
| Setting | Value |
|---|---|
| Display name | Date |
| BRQL name | Date |
| Data type | Date |
| Value(s) | Single value |
| Required | Yes |
| Default value | None |
| Input mode | Type any value |
- Select OK to save the parameter
- Enter the following calculation:
(SELECT SUMZ([t.Amount]) FROM [$.Transactions t] WHERE [t.IsPayment] = TRUE AND [t.Gateway] = 'gift_card' AND [t.Date.Day] <= [@Date])
- Select Save
How the calculation works:
| Part | What it does |
|---|---|
SELECT SUMZ([t.Amount]) |
Sums the transaction amount across all the rows returned by the subquery to give one value per gift card |
FROM [$.Transactions t] |
Queries the Transactions table for all rows related to the gift card id |
WHERE [t.IsPayment] = TRUE AND [t.Gateway] = 'gift_card' AND [t.Date.Day] <= [@Date] |
Filters the Transactions table to successful gift card payments on or before the selected date |
Step 3 β Create the Balance on @Date custom dimension
This custom dimension approximates the gift card's balance on the selected date by subtracting the Amount spent up to @Date from the gift card's initial value. Gift cards that were issued after the selected date return a value of zero.
- Select Edit, then + Create new, then Create Dimension
- Set the Primary table to GiftCard
- Set the Display name to Balance on {@Date}
- Set the Description to Approximates the balance of a gift card on a selected date by subtracting the amount spent up to the date from the initial gift card value
- Set the Data type to Number and the Numeric type to Currency
- Select + Add parameter and configure a
@Dateparameter using the same settings as Step 2 - Enter the following calculation:
CASE WHEN [$.IssuedAt.Day] <= [@Date] THEN [$.InitialValue] - [$.AmountSpentUpToDate(@Date)] ELSE 0 END
- Select Save
How the calculation works:
| Part | What it does |
|---|---|
CASE |
Evaluates a set of conditions and returns a value based on the first true condition |
WHEN [$.IssuedAt.Day] <= [@Date] |
Checks whether the gift card was issued on or before the selected date |
THEN [$.InitialValue] - [$.AmountSpentUpToDate(@Date)] |
If True : subtract the amount spent up to the selected date from the gift cardβs initial value |
ELSE 0 |
If False : returns zero β the gift card did not exist on the selected date |
Step 4 β Create the Gift card active on @Date custom dimension
This custom dimension returns true for gift cards that were issued on or before the selected date and had not yet expired or been disabled at that date. It is used as a filter in Step 6 to scope the report to cards that were active at the point in time being reviewed.
- Select Edit, then + Create new, then Create Dimension
- Set the Root table to GiftCard
- Set the Display name to Gift card active on {@Date}
- Set the Description to Returns true for gift cards that were issued on or before the selected date and had not yet expired or been disabled
- Set the Data type to Yes/No
- Select + Add parameter and configure the
@Dateparameter using the same settings as Step 2 - Enter the following calculation:
IS_TRUE( [$.IssuedAt.Day] <= [@Date] AND ([$.ExpiresOn.Day] > [@Date] OR [$.ExpiresOn] IS NULL) AND ([$.DisabledAt.Day] > [@Date] OR [$.DisabledAt] IS NULL))
- Select Save
How the calculation works:
| Part | What it does |
|---|---|
[$.IssuedAt.Day] <= [@Date] |
Checks the gift card was issued on or before the selected date |
[$.ExpiresOn.Day] > [@Date] OR [$.ExpiresOn] IS NULL |
Checks the gift card had not yet expired β cards with no expiry date are treated as not expired |
[$.DisabledAt.Day] > [@Date] OR [$.DisabledAt] IS NULL |
Checks the gift card had not been disabled β cards with no disabled date are treated as not disabled |
Step 5 β Add fields to the report
Add the following fields to the report. When adding the custom parameterised fields, enter the date you want to report on when prompted. Use the same date for both fields β the field names will update automatically to reflect the date you selected, for example, Amount spent up to Dec 31, 2025 and Balance on Dec 31, 2025.
| Field | Type |
|---|---|
| Issued at | Dimension |
| Last four characters | Dimension |
| Amount spent up to @Date | Dimension (custom) |
| Balance on @Date | Dimension (custom) |
π‘ The Gift card active on @Date field does not need to be added as a visible column β it is used as a filter in Step 6. If you want it visible in the report for reference, add it here using the same date.
Step 6 β Add filters
Add the following filters using AND logic to restrict the report to gift cards that were active and had a remaining balance on the selected date:
- Select Add filter, choose Gift card active on @Date, and set the operator to is Yes
- When prompted, enter the same date used in Step 5
- Select Add filter and choose the Balance on @Date field from the top of the list β this is the version already configured with your selected date
- Set the operator to greater than and enter
0
Step 7 β Sort the report
The report is sorted by Issued at date ascending by default, showing the oldest gift cards first. Adjust to suit your needs β for example, sorting by Balance on @Date descending shows the highest-value gift cards first, which is useful when reviewing total liability.
Step 8 β Save the report
Select Save and save the report with a name such as Gift card balances on [selected date]. Using the date in the report name makes it easy to distinguish saved snapshots if you run the report for multiple dates.
Interpreting the results
Each row represents a single gift card that was active and had a remaining balance as of the selected date. Review the balance values across rows to assess your outstanding gift card liability at that point in time β to see a single total figure, see Add a grand total row in the Variations and extensions section.
- A gift card appears in the report with a positive balance β the gift card was issued on or before the selected date, had not expired or been disabled, and still had a remaining balance. Include these gift cards when estimating your outstanding gift card liability as of that date.
- A gift card appears with a remaining balance even though it is no longer active today β this is expected. The report reflects each card's status and balance as of the selected date rather than its current state. Cards that have since expired, been disabled, or been fully redeemed will still appear if they had a positive balance on the selected date.
- Changing the selected date changes which gift cards appear or their balances β the report recalculates both the historical balance and active status using the selected date each time it is run. Running the report for multiple dates lets you track how your outstanding gift card liability has changed over time.
- A gift card you expected to see is missing β the card was likely fully redeemed before the selected date and has a balance of zero, which the balance filter excludes. It may also have been issued after the selected date, or expired or disabled before it. Check the filters in Step 6 if you need to confirm which conditions are applied.
Variations and extensions
Add a grand total row
To see the total balance and amount spent across all gift cards in the report, the Balance on @Date and Amount spent up to @Date dimensions need to be converted to measures before the grand total will calculate. Drag each field from the Selected dimensions pane into the Selected measures pane as a quick measure with the SUM aggregation. Then toggle the Show grand total checkbox.
Compare liability across multiple dates
Running the report for a single date gives a snapshot. To track how your outstanding gift card liability has changed over time β useful for monthly financial reporting or year-end reconciliation β run the report for multiple dates and save each version separately.
Each time you run the report for a new date, update the @Date parameter across all fields and filters to the new date, then select Save as to save a new copy with the date in the report name.
π‘ Updating the date in one parameterized field does not update it across the others automatically. Each field and filter that uses the @Date parameter must be updated individually to the same date. See Add and update dynamic fields in a report for the steps to update a parameter value.
Filter by gift card source
The Source field identifies the channel through which each gift card was issued β for example, online store, point of sale, or a third-party integration. Adding it to the report as a filter or dimension lets you break down your outstanding liability by issuing channel.
This is useful for stores that issue gift cards across multiple channels and need to understand the liability split β for example, separating online gift card liability from in-store gift card liability for reporting or reconciliation purposes.
To add it as a dimension, add the Source field to the report and adjust the sort hierarchy to group by Source first, then by Balance on @Date descending. To restrict the report to a specific channel, add Source as a filter instead and select the channel you want to analyse.
Need more support?
If you get stuck or have additional questions, you can contact our team directly through the Help widget in the bottom-right corner β we typically respond within one business day.