Skip to contents

A short description...

Usage

qoq(.data, .date, .value, calendar_type, lag_n = 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' or '5-5-4' calendar, see 'Details' for additional information

lag_n

the number of periods to lag

Value

ti object

See also

Other time_intelligence: atd(), dod(), mom(), momtd(), mtd(), mtdopm(), pmtd(), pqtd(), pwtd(), pytd(), qoqtd(), qtd(), qtdopq(), wow(), wowtd(), wtd(), wtdopw(), yoy(), yoytd(), ytd(), ytdopy()

Examples

qoq(sales,.date=order_date,.value=quantity,calendar_type='standard',lag_n=1)
#> 
#> ── Quarter over quarter ────────────────────────────────────────────────────────
#> Function: `qoq` was executed
#> 
#> ── Description: ──
#> 
#> This creates a full quarter `sum()` of the previous quarter quantity and
#> compares it with the full quarter `sum()` current quarter quantity from the
#> start of the standard calendar quarter to the end of the quarter
#> 
#> ── Calendar: ──
#> 
#> • The calendar aggregated order_date to the quarter time unit
#> • A standard calendar is created with 0 groups
#> • Calendar ranges from 2021-05-18 to 2024-04-20
#>222 days were missing and replaced with 0
#> • New date column date, year and quarter was created from order_date
#> 
#> ── Actions: ──
#> 
#> Error in str_detect(x@action@value[[1]], "32m"): could not find function "str_detect"