Forum Discussion
mcguija
2 years agoHelper III
Generateseries with Dates
Hi, so i'm trying to create column with flag, 1/0 to filter on dates. The dates i'm looking for are the last 3 quarters to date. So today being 2024-01-11 it should return 1 for dates between 2023-...
- 2 years ago
That worked! I only had to add Datevalue() to my date dim column, see below. Thanks so much!
Column Flag For Rolling prev 3 Quarters and current QTD =var q = QUARTER(EDATE(TODAY(),-9))var y = YEAR(EDATE(TODAY(),-9))return if(DATEVALUE([CAL_DATE_YR_MTH_DAY_E]) >= DATE(y,q*3-2,1) && DATEVALUE([CAL_DATE_YR_MTH_DAY_E])<= TODAY(),1,0)
lbendlin
2 years agoSuper User
.
Column Flag For Rolling prev 3 Quarters and current QTD =
var q = QUARTER(EDATE(TODAY(),-9))
var y = YEAR(EDATE(TODAY(),-9))
return if([CAL_DATE_YR_MTH_DAY_E]) >= DATE(y,q*3-2,1) && [CAL_DATE_YR_MTH_DAY_E]<= TODAY(),1,0)
mcguija
2 years agoHelper III
hmm, something is missing, throwing errors.
- lbendlin2 years agoSuper User
Column Flag For Rolling prev 3 Quarters and current QTD = var q = QUARTER(EDATE(TODAY(),-9)) var y = YEAR(EDATE(TODAY(),-9)) return if([CAL_DATE_YR_MTH_DAY_E] >= DATE(y,q*3-2,1) && [CAL_DATE_YR_MTH_DAY_E]<= TODAY(),1,0) - mcguija2 years agoHelper III
That worked! I only had to add Datevalue() to my date dim column, see below. Thanks so much!
Column Flag For Rolling prev 3 Quarters and current QTD =var q = QUARTER(EDATE(TODAY(),-9))var y = YEAR(EDATE(TODAY(),-9))return if(DATEVALUE([CAL_DATE_YR_MTH_DAY_E]) >= DATE(y,q*3-2,1) && DATEVALUE([CAL_DATE_YR_MTH_DAY_E])<= TODAY(),1,0)