Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with date issues in expression

I have the following in an expression and it works great.

Sum({<CalendarWrittenDate={'>=$(=AddMonths((MonthStart(Today())),-14))<=$(=MonthEnd(AddMonths((Monthend(Today())),-3)))'}>} Quantity)

It basically counts the quantity a product has sold for the previous 12 months.

However, when I change the date parament of today() to a different date, it does not work.  The date I am entering is the product introduction date and I am trying to see how the product did the first 3 months of sales.  It returns 0.  I am assuming something is different about my CalendarIntroductionDate.  Thoughts?????

Sum({<CalendarWrittenDate={'>=$(=AddMonths((MonthStart(CalendarIntroductionDate)),+1))<=$(=MonthEnd(AddMonths((Monthend(CalendarIntroductionDate)),+3)))'}>} Quantity)

1 Reply
Not applicable
Author

Is CalendarIntroductionDate a valid date? If its text-based, you will need to convert it using

Date#(CalendarIntroductionDate, 'M/D/YY')