Guides · Beyond customer lists
Lapsed memberships: who didn't renew in the last 30 days
Count the members whose end date fell in the last 30 days and who have no renewal date, and total the fees they paid. In the test file of 24 club members, that is 8 lapsed, worth 860.00 a year, with 3 more due to end in the next 30 days.
Ask your agent
With Sift connected (add it to Claude Code), paste this and swap in your own paths and column names.
Use Sift on /path/to/club_memberships.csv as of 2026-11-01. Count the members whose end_date is within the last 30 days and whose renewed_on is blank, and total their annual_fee. Then count the ones whose end_date is due in the next 30 days and who haven't renewed yet. Then, with /path/to/rules.memberships.json, dry run set_if to write Lapsed in the follow_up column for the lapsed members, and apply it if I say yes.
What Sift sends back
A count gives numbers, not names. To get the list, the set_if fix writes Lapsed in a follow_up column on a new copy of the file. Its changes-only file lists the 8 member IDs, one per row. The blank fee is left out of the total and counted, never treated as 0.
How the dates are counted
- The as-of date fixes "today", so the same file always gives the same count. Put it in the prompt or in the rules file as
as_of. - Last 30 days (
within_days30) counts end dates from 30 days before the as-of date up to the as-of date, both ends included. Here, 2 October to 1 November. - Next 30 days (
due_within_days30) counts end dates from the as-of date to 30 days after it. Here, up to 1 December: a member ending on 1 December counts, one ending on 2 December doesn't. - Not renewed means the renewed_on column is blank. If your system marks renewals another way, such as a status of Expired, ask for that column instead.
What to do next
- Send the 8 member IDs from the changes file to whoever chases renewals, not a copy of the file.
- Fix the "TBC" end date at the source. Sift will not guess it.
- The fix needs a rules file with a share-of-rows limit. 8 of 24 is 33.3%, so this one allows up to 50%:
{"guardrails": {"stop_if_share_of_rows_changed_over": 0.5}}. Your file is never changed, and undo rebuilds the original byte for byte.
Questions
So the count is repeatable. The last 30 days and the next 30 days are measured from the date you give, never from today's clock.
Yes.
due_within_days counts dates from the as-of date up to that many days after it. In the test file, 3 members end in the next 30 days and haven't renewed.The counts read CSV, Excel, JSON and Parquet. The set_if fix that writes the follow_up column works on CSV only, so save the sheet as CSV for that step.
The same counts work for any end date: subscriptions, contracts, insurance policies, licences.