Skip to content

Commit 8a59078

Browse files
author
hagan
committed
errors in base code
1 parent d2ab76e commit 8a59078

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

R/time_intelligence_fn.R

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ qtdopq_fn <- function(x){
456456
out_dbi <- qtd_dbi |>
457457
dplyr::left_join(
458458
qoq_dbi
459-
,by=dplyr::join_by(year,quater,!!!x@datum@group_quo)
459+
,by=dplyr::join_by(year,quarter,!!!x@datum@group_quo)
460460
)
461461

462462
return(out_dbi)
@@ -493,9 +493,6 @@ mtd_fn <- function(x){
493493
dplyr::mutate(
494494
!!x@value@new_column_name_vec:=cumsum(!!x@value@value_quo)
495495
,.by=c(year,month,!!!x@datum@group_quo)
496-
) |>
497-
dplyr::mutate(
498-
days_in_current_period=lubridate::day(date)
499496
)
500497

501498
return(out_dbi)
@@ -818,7 +815,7 @@ pwtd_fn <- function(x){
818815
!is.na(year)
819816
)
820817

821-
return(out_tbl)
818+
return(out_dbi)
822819

823820
}
824821

@@ -839,20 +836,20 @@ wowtd_fn <- function(x){
839836

840837
# ytd table
841838

842-
wtd_tbl <- wtd_tbl(x)
839+
wtd_dbi <- wtd(x)
843840

844841
#pytd table
845842

846-
pwtd_tbl <- pwtd_tbl(x) |>
843+
pwtd_dbi <- pwtd(x) |>
847844
dplyr::rename(
848845
!!x@value@second_column_name:=!!x@value@new_column_name_quo
849846
)
850847

851848
# join tables together
852849

853850
out_tbl <- dplyr::left_join(
854-
wtd_tbl
855-
,pwtd_tbl
851+
wtd_dbi
852+
,pwtd_dbi
856853
,by=dplyr::join_by(date,year,month,week,!!!x@datum@group_quo)
857854
)
858855

@@ -971,7 +968,7 @@ atd_fn <- function(x){
971968
!!x@value@new_column_name_vec:=cumsum(!!x@value@value_quo)
972969
,.by=c(!!!x@datum@group_quo)
973970
)
974-
return(out_tbl)
971+
return(out_dbi)
975972
}
976973

977974

0 commit comments

Comments
 (0)