Skip to content

Commit 4cb90ea

Browse files
committed
Update GetConceptRecordCount.R
1 parent 0cd8c66 commit 4cb90ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/GetConceptRecordCount.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ getConceptRecordCount <- function(conceptIds = NULL,
128128
'@domain_field_short' domain_field_short,
129129
'@calendar_type' calendar_type,
130130
{@incidence} ? {1} : {0} incidence,
131-
{@use_age_group} ? {FLOOR((YEAR(cohort_start_date) - year_of_birth) / 10) AS age_group,} : {-1} age_group,
131+
{@use_age_group} ? {FLOOR((YEAR(@domain_start_date) - year_of_birth) / 10)} : {-1} age_group,
132132
COUNT_BIG(*) concept_count,
133133
COUNT_BIG(DISTINCT dt.person_id) subject_count,
134134
MIN(@domain_start_date) min_date,
@@ -197,7 +197,7 @@ getConceptRecordCount <- function(conceptIds = NULL,
197197
{@gender_concept_id} ? {p.gender_concept_id, }
198198
{@use_date_year} ? {DATEPART(yy, @domain_start_date),}
199199
{@use_date_month} ? {DATEPART(mm, @domain_start_date),}
200-
{@use_age_group} ? {FLOOR((YEAR(cohort_start_date) - year_of_birth) / 10) AS age_group,}
200+
{@use_age_group} ? {FLOOR((YEAR(@domain_start_date) - year_of_birth) / 10),}
201201
{@use_date_quarter} ? {DATEPART(qq, @domain_start_date),}};
202202
203203
"

0 commit comments

Comments
 (0)