1 Reply Latest reply: Dec 22, 2016 11:37 AM by Sunny Talwar

# Need Help - Date Range Calclulation

hi All:

The existing questions in the forum got me this far (thanks to all previous posts), however I am stuck.

I have an existing calculating that gives me YTD Sales thru Current Week, I am trying to do same thing but for last year and I am striking out. See below.

Ray

// Trying to get sales thru current week for last year.  I got it to work for current, but having issues for last

// These are my revised date statements and yield the dates I want

//New Code for LAST YEAR

//ORIGINAL CODE FOR CURRENT YEAR

// SUM({\$<KEY_DATE = {'>=\$(=YearStart(Today()))<=\$(=WeekEnd(Today()))'}>}[Invoice Subtotal])

• ###### Re: Need Help - Date Range Calclulation

May be this:

Sum({\$<KEY_DATE = {'>=\$(=YearStart(Today(), -1))<=\$(=WeekEnd(AddYears(Today(), -1)))'}>}[Invoice Subtotal])

or

Sum({\$<KEY_DATE = {'>=\$(=YearStart(Today(), -1))<=\$(=AddYears(WeekEnd(Today()), -1))'}>}[Invoice Subtotal])