Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: MTD and YTD comparing Post Reply Post New Topic
Author Message
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Topic: MTD and YTD comparing
     Posted: 28 Nov 2012 at 11:41am
Hello Help-
I have 5 views containing daily sales totals for each brand of product, and an operations calendar of work days linked by date [left outer join so every day of the year is listed regardless of whether there is a sale on the brand]. I'm trying to recreate an excel spreadsheet in which the president plugs in sales dollars provided to him for the month [by brand] and it calculates the total for the month, the difference [percentage] between that current month and the same month last year, and the YTD difference [percentage] between the running total this year and last year. The report looks something like;
 
Month       Cully     Redmore     Total        Diff 2011            YTD vs LY
January    $5.00      $10.00      $15.00       -1.09%                  +4.67%
February   $10.00    $6.00        $16.00       +2.09%                 +6.10%
etc, etc,
2012 months start after December 2011......
 
I have the daily totals sorted in date order, I have a grouped by month and then grouped by year with summaries for all the fields except YTD which is a running total that resets at the next group [new year4]. I cannot figure out how to make a new formula to compare January of 2012 to January of 2011 and the same new formula to compare the running total of the previous year to the same current year period. Any help will be really appreciated!
Be kind to those less fortunate.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Nov 2012 at 3:48am
I suggest creating two more views - one that will calculate the month-to-date total for the previous year and one that will calculate the year-to-date total for the previous year.  You can use the value of the current date in your view SQL to get these values.  Then join those views into your report to get the data you're looking for.
 
-Dell
IP IP Logged
Minco
Groupie
Groupie
Avatar

Joined: 28 Nov 2012
Location: United States
Online Status: Offline
Posts: 62
Quote Minco Replybullet Posted: 29 Nov 2012 at 3:55am
Thank you for the suggestion - I'm actually relieved to hear I can't perform this with a formula because it's been driving me crazy trying to figure it out. A few more views will probably do the trick.
 
Thanks again-
Minco
Be kind to those less fortunate.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum