Skip to content
Sad Subscription Analytics
Menu

Date ranges, grouping, sorting and search

Every SSA report page (Dashboard excepted) shares one toolbar and one table frame. This page covers the parts every report has in common: the date range picker, Group by, the search box, column sorting and pagination.

The date range button and popover

The toolbar's first control is a single button showing a calendar icon, the current range label and a chevron. Clicking it opens a popover of preset rows followed by an always-visible "Custom range" section with two date inputs and an Apply button.

FieldWhat it doesDefault
This monthThe 1st of the current month to today.
On screen: "This month"
Last 30 daysToday minus 30 days to today.
On screen: "Last 30 days"
This quarterThe first day of the current calendar quarter to today.
On screen: "This quarter"
This year1 January to today.
On screen: "This year"
Last 12 monthsExactly one calendar year back from today to today (a calendar year, not 365 days). The default on first visit to a backward-looking report.
On screen: "Last 12 months"
All time1970-01-01 to today.
On screen: "All time"
Custom rangeTwo date inputs, Start date and End date, plus an Apply button. Apply does nothing until both dates are filled; a start after an end has the two swapped; missing or invalid dates silently fall back to Last 30 days.
On screen: "Custom range"

On the one forward-looking report, Upcoming Payments, the preset rows are Next 7 days, Next 30 days (default) and Next 90 days instead, each resolving to today through today plus N days inclusive; an unrecognized forward preset resolves as 30 days. All boundaries are computed in UTC (00:00:00 to 23:59:59).

The button label is the preset's name, or for a custom range the literal "YYYY-MM-DD – YYYY-MM-DD" (en dash, raw ISO dates). Escape or a click outside the picker closes it. Changing the range re-fetches the summary, rows and pagination by AJAX, resets to page 1, and rewrites the browser URL so the view can be bookmarked or shared.

The sticky default, and the "Showing data since" caption

Clicking a preset row on a backward-looking picker saves it as that WordPress user's sticky default for every backward report; custom ranges and forward windows are never saved. Forward reports (Upcoming Payments) ignore the saved preference and always start on their own default.

When the All time preset is active, a caption "Showing data since ." appears above the summary cards, naming the earliest date that report has data for. It is empty when there is no data, or when the report has no date basis of its own (Revenue and MRR).

Group by

Group by is a select with a "None" option plus whichever dimensions a report allows; it is left off the toolbar entirely for a report that allows none (Revenue and MRR). Choosing a group re-fetches from page 1 and clears any active column sort. Across SSA's reports the full set of group-by labels is: Plan / product, Status, Source, Billing interval, Tenure, Type, New vs returning, Payment method, Referral source, Month, Due month and Due week; which of these a given report offers varies.

Grouped and date-bucket views

Grouping by a non-date dimension (for example Plan / product) keeps the normal table: rows are listed under a colored group header row, a "Subtotal: " row follows for the money columns, and a "Grand total" footer sums every summable column across the current page. An empty group value is labeled "(none)".

Grouping by a date bucket (Month, Due month, Due week) replaces the table with a collapsed accordion instead: one row per bucket with the bucket label, a Count, and one true total per money column across the whole bucket, not just a page slice. There is no pagination strip in this view; up to 500 buckets are rendered, newest first on backward reports and soonest first on Upcoming Payments.

Each bucket row is clickable and expands to lazily fetch that bucket's individual rows. If a bucket holds more than 25 rows, the expanded panel ends with a "View all in this period" link that opens the report with a custom range equal to that bucket. An "Expand all" button (toggling to "Collapse all") appears whenever at least one bucket is expandable, fetching at most three buckets at a time. If a bucket's rows fail to load, collapsing and re-opening it retries.

Search

The Search box, placeholder "Search", is always drawn in the toolbar with a 350ms typing debounce, but not every report actually filters on it. On Reactivations it matches the customer's email or WordPress display name; on Payment Recovery it matches the customer's email only. On Revenue and MRR and Upcoming Payments, typing changes the URL but never the rows, because those reports' row-building code never reads the search term.

Sorting

Sortable column headers render as a button with an arrow; buttons appear only when no Group by is active and only for columns a report explicitly allows. First click on a date column sorts newest or soonest first; first click on any other column sorts ascending; clicking the same header again flips direction. Sorting resets to page 1 and is written to the URL as orderby and order; it is never saved as a preference, so it always starts fresh on the report's own default order.

Pagination

Rows page 25 at a time. Below the table a strip reads "Showing X–Y of Z" with WordPress-style page links (Previous, Next, numbers with a neighbor and end pages); nothing is rendered when there are zero rows. Page links are intercepted by JavaScript and fetch the page in place, preserving every existing filter, range and sort parameter; the paged parameter is only written to the URL for pages beyond 1. The total row count runs a COUNT query only when a page comes back full (25 rows); a short page derives the total without a second query.

A collapsed date-bucket accordion (see Grouped and date-bucket views, above) has no pagination strip of its own; it shows every bucket up to 500 instead.