Ask when the behavior happened
A count tells you how often something was recorded. It leaves the sequence open. Three event registrations before a decision opens describe a different moment from three registrations afterward. A cluster of portal logins last autumn is different from a streak this week.
Feature Engineering Act 2 develops that distinction through three builds: counts within a time window, login streaks and a history of scores. Each adds a different kind of context. A calendar window compares a recurring part of the cycle; a milestone window follows an individual's sequence; a snapshot series records how a calculated value changes.
In the recording · 06:57 ↗Keep the calendar window and the population separate
The first example copies an existing event-attendance count and narrows it to the second half of April. A month comparison selects April, and a day comparison includes the 15th onward. The existing cutoff also limits the count to activity before a deposit or its configured fallback.
That combination matters. A month-and-day test describes a recurring season, but it does not by itself select an application cycle or a year. Keep the population and cycle scope visible alongside the calendar rule. If the purpose is a year-over-year comparison, make sure each cohort is being measured through a comparable point.
Test the corners before looking at totals: April 14, April 15, April 30 and May 1, plus an event after the individual's cutoff. Name the export after the actual window. The narration revises the proposed range as the live filters are built, so the finished definition should follow the conditions rather than the first phrase spoken.
In the recording · 07:54 ↗Choose the timestamp that matches the action
The next count asks about event registrations after an admission decision is opened. The build distinguishes that opening from the decision being created or released. It also corrects the other endpoint: an event's start date would measure attendance timing, while the form-response submission date represents registration.
A date-difference calculation then supports a window from zero through seven days. Write down whether your intended rule uses calendar-day boundaries or exact elapsed time, including the relevant timezone. A registration around midnight is a useful test because the date can change after only a few minutes.
Copying a query is convenient, but it copies its old assumptions too. The recording removes the attendance condition when the question changes to registration and revisits the earlier deposit cutoff. Inspect every inherited filter. A registration count should not quietly require attendance merely because its source query did.
In the recording · 12:21 ↗Decide what a streak is supposed to measure
Sequential Value Groups supplies the next tool. The demonstration converts direct portal-login dates into day offsets from a fixed anchor, groups consecutive values and returns the size of each group. Minimum and maximum offsets are converted back to dates so the result has readable endpoints. Impersonated staff logins are excluded from the student activity measure.
The same structure can answer several questions. What was the longest weekly streak? How many streaks lasted more than one day? How many days were contained in those longer streaks? For groups lasting two, five and seven days, the count is three and the sum of their lengths is fourteen. Those are different features, even though they begin with the same records.
Keep the unit in the name. Weekly groups need an agreed week boundary, and a daily streak should not grow because someone logged in several times on one day. Test repeated logins, a gap, a boundary crossing and a staff impersonation. A streak records a pattern of access; it cannot explain the person's reason for returning.
In the recording · 18:51 ↗Store snapshots before asking about change
The final build creates an application-scoped historical score entity with fields for a total, score type and an average-change value. Keeping a score type allows one history structure to hold different measures without mixing them in a comparison.
The calculation retrieves the latest and second-latest values of the selected type, sorted by creation date, then compares their totals and dates. The recording explicitly notes that another query must populate those snapshots. Creating the entity alone will not produce a history.
Choose a capture schedule, a reliable observation date and a way to identify the scoring definition used. If weights or rules change, a jump in the stored score may reflect the calculation rather than new activity. Keep the raw snapshots available so someone can examine the difference instead of trusting only the derived rate.
In the recording · 33:05 ↗Read the average as an average
Subtracting the older total from the newer total gives the score change. Dividing by the elapsed days gives an average rate across that interval. A rise from ten to fifteen over five days is one point per day on average; it does not establish that one point was earned on each day.
The build adds a zero-denominator guard. Extend the test to a first snapshot with no predecessor, two snapshots on the same day and two score types interleaved in time. Check which pair is selected and how an unavailable rate is displayed. A transparent missing result is more useful than a number produced from the wrong pair.
Bring the three builds together by keeping their questions separate. A window counts activity in a defined period, a streak describes continuity, and a snapshot comparison tracks a calculated measure. Clear names and a few boundary cases make those features useful beyond the person who first built them.
In the recording · 42:38 ↗