These are wrong-value bugs: the functions ran without error but returned incorrect numbers.
wow() returned several rows per week (569 rows for 153 weeks on
contoso::sales), and some rows compared a week with itself. A week that
spanned two week numbers or two months was split into several rows. wtdopw()
was affected through wow()."445", "454", "544"), yoy(), qoq(), mom()
and mtdopm() returned several rows per period. Periods were built from
calendar months, quarters and years rather than fiscal ones.pmtd() and momtd() used values from other groups when a group had
no data in the previous month.pytd(), pqtd() and pmtd() added two earlier days together when both
mapped to the same date (for example 28 and 29 February 2024 both onto
28 February 2025), and pqtd() returned NA on some month ends (30 and
31 May). Each date now compares with exactly one point in the earlier period;
on the last day of a month that is the end of the earlier month.pytd() and yoytd() failed with argument "lag_n" is missing unless
lag_n was given. It now defaults to 1, like the other functions.yoytd(), qoqtd(), momtd(), wowtd(),
ytdopy(), qtdopq(), mtdopm(), wtdopw()) ignored fiscal_year_start.mtdopm() returned two quarter columns (quarter.x and quarter.y).week_start argument on every time intelligence function (1 = Monday
to 7 = Sunday, default 7). On the standard calendar, weeks start on that day
and week 1 is the week containing 1 January, so only the weeks either side of
1 January can be partial. Weeks no longer split at month ends. On retail
calendars, week_start sets the weekday fiscal periods start on.week_start and fiscal_year_start are on every function because the retail
calendars build every fiscal period from whole weeks. On the standard
calendar fiscal_year_start has no effect and week_start only affects the
week functions and the week column. Changing either where it has no effect
now shows a message, and the printed summary says the same.week column now follows week_start. It was previously the ISO week
for day-level results.wtd(), pwtd() and wowtd() now reset at the start of each week. They
previously reset at seven-day blocks counted from 1 January and at every
month end.pytd(), pmtd() and pwtd() (and yoytd()) return one row per calendar
date, like the other functions. They previously added rows after the last
date in the data.ti no longer writes to the database. The retail calendars and the abc()
threshold table were created with copy_to(); they are now built inside the
query with dbplyr::copy_inline(), so read-only access is enough. This also
fixes retail-calendar results that were created earlier being changed by a
later call, because every call overwrote the same retail_calendar table.tests/testthat/helper-reference.R), ungrouped and grouped,
with every week_start day, and on the retail calendars, plus hand-computed
examples. Previously most functions were only tested for running without
error.abc() and cohort().week_start days, the 4-5-4 and 5-4-4
calendars, and tests that duplicate the reference checks) are skipped on
CRAN to keep check time down. Every function is still checked against the
reference on CRAN, on the standard and 4-4-5 calendars.ytd() details,
inherited by 21 help pages, which produced "trimming empty calculate() and create_calendar() to NAMESPACE. roxygen2 8.0.0 no
longer emits an export from @export on an S7::method()<- block, so both
generics were silently dropped and every call failed with "'calculate' is not
an exported object from 'namespace:ti'"export(print) directive; the print() methods are
registered at load time by S7::methods_register()new_generic() definitions, per
vignette("rd-S7", package = "roxygen2")@prop for read-only computed propertiesR/utils-misc.R that had run togetherThis release fixes the check ERRORs that led to 'ti' being archived on CRAN on 2026-04-06. It was never published to CRAN; its changes reach users in 4.2.1.
margin renamed to gross_margin).
This was the cause of the CRAN check ERRORs in 4.0.0.abc() documentation using old column name*_fn functions to use template patternassertthat dependency with cli::cli_abort for consistent error handlingscales dependency (inlined percent formatting)assertthat, scales