Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: lastyearytd Post Reply Post New Topic
Author Message
bwolfred
Newbie
Newbie
Avatar

Joined: 19 Mar 2013
Online Status: Offline
Posts: 3
Quote bwolfred Replybullet Topic: lastyearytd
     Posted: 19 Mar 2013 at 9:30am
I'm fairly new to Crystal Reports and cannot figure this one out.
 
I'm trying to pull a sales report showing the total sales for "current year to date" and compare that to the "same period last year".  I was able to build my report detail to only show the transactions that I need (current year to date, and same period last year) with the following Group formula:
 
(({wbw_line1.INV_DATE} in yeartodate and {wbw_line1.INV_DATE}<Minimum(monthtodate)) or ({wbw_line1.INV_DATE}in lastyearytd and {wbw_line1.INV_DATE}<minimum(lastyearmtd)))
 
However, when I summarize the transactions in either the "Group Header" or in a "Side by Side Bar Chart" it pulls the sum of the "total sales from last year".
 
Is there a way to have the report summarize the "same period last year"?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 9:40am
in you select expert change it to use
{wbw_line1.INV_DATE} in YTD or {wbw_line1.INV_DATE} in LastYearYTD
group on the {wbw_line1.INV_DATE} and set the grouping to per year
insert a sum of sales field at the group footer
in the sideby side bar chart reference that summary
IP IP Logged
bwolfred
Newbie
Newbie
Avatar

Joined: 19 Mar 2013
Online Status: Offline
Posts: 3
Quote bwolfred Replybullet Posted: 19 Mar 2013 at 9:52am
Thank you for the quick reply.
 
I made the changes that you suggested.  However, it is still pulling the total sales for all of last year.
 
Any thoughts?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 10:03am

do not use group select , use record select

IP IP Logged
bwolfred
Newbie
Newbie
Avatar

Joined: 19 Mar 2013
Online Status: Offline
Posts: 3
Quote bwolfred Replybullet Posted: 19 Mar 2013 at 10:43am
That did it!!  Rookie mistake.
 
Thank you so much for your help!
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