4 Replies Latest reply on Apr 1, 2016 1:47 PM by Anne Laverick

Prior YTD Calculation

I am trying to bring in the Prior Year YTD sales into the report, yet all I am getting with this remaining sales for the year and not the sales for the 1Q of last year. Below is my formula

If DATEDIFF('month',[Month],Today())=13 AND DATEDIFF('month',[Month],Today())=24 THEN [Sales] END

• 1. Re: Prior YTD Calculation

Try this

replace [Date] with your desired date, returns True if the date is in the YTD previous or current

YEAR([Date]) >= YEAR(TODAY())-1 AND (MONTH([Date]) < MONTH(TODAY()) OR (MONTH([Date]) == MONTH(TODAY()) AND DAY([Date]) <= DAY(TODAY())))

• 2. Re: Prior YTD Calculation

When I put it in like this then I get a syntax error around the Then  portion

YEAR() >= YEAR(TODAY())-1 AND (MONTH() < MONTH(TODAY()) OR (MONTH() == MONTH(TODAY()) AND DAY() <= DAY(TODAY())))THEN  END

Anne Laverick

Controller

Clesen Wholesale

Phone: 847-869-2257 Ext. 215

Direct Dial – 847-448-4215

Fax: 847-869-1672

www.clesen.com<http://www.clesen.com>

• 3. Re: Prior YTD Calculation

Fix.  Thanks.

Anne Laverick

Controller

Clesen Wholesale

Phone: 847-869-2257 Ext. 215

Direct Dial – 847-448-4215

Fax: 847-869-1672

www.clesen.com<http://www.clesen.com>

• 4. Re: Prior YTD Calculation

Now that I have brought in my current month data my PY YTD is adding together my 2015 and my 2016 sales into the number.

What is wrong.

Below is my formula

if YEAR() >= YEAR(TODAY())-1 AND (MONTH() < MONTH(TODAY()) OR (MONTH() == MONTH(TODAY()) AND DAY() <= DAY(TODAY())))THEN  END

Anne Laverick

Controller

Clesen Wholesale

Phone: 847-869-2257 Ext. 215

Direct Dial – 847-448-4215

Fax: 847-869-1672

www.clesen.com<http://www.clesen.com>