Forum Discussion

mcguija's avatar
mcguija
Helper III
2 years ago
Solved

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-...
  • mcguija's avatar
    mcguija
    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)