Skip to contents
  • This calculates the full quarter value compared to the previous quarter value respecting any groups that are passed through with dplyr::group_by()

  • Use calculate to return the results

Usage

qoq(
  .data,
  .date,
  .value,
  calendar_type = "standard",
  lag_n = 1,
  fiscal_year_start = 1
)

Arguments

.data

tibble or dbi object (either grouped or ungrouped)

.date

the date column to group by

.value

the value column to summarize

calendar_type

select either 'standard', '445', '454', or '544' calendar, see 'Details' for additional information

lag_n

the number of periods to lag

fiscal_year_start

integer 1-12, the month the fiscal year starts nearest to (default 1 = January). Only used with retail calendars ('445', '454', '544').

Value

ti object

Examples

if (FALSE) { # \dontrun{
library(contoso)
qoq(sales,.date=order_date,.value=quantity,calendar_type='standard',lag_n=1)
} # }