Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Creating 'Year to Date' formula for P&L Post Reply Post New Topic
Author Message
Larry Wildman
Newbie
Newbie


Joined: 07 Apr 2009
Location: United States
Online Status: Offline
Posts: 1
Quote Larry Wildman Replybullet Topic: Creating 'Year to Date' formula for P&L
     Posted: 07 Apr 2009 at 3:47am
Hello Everyone!

I'm new to the site, but am ecstatic that it exists!  I'm a new Crystal Reports junky and have been playing with XI for a few weeks now.  I've started creating Financial Reports but am stuck on how to create a 'Year to Date' column on my P&L.  Obviously no issues with current period figures, but can't seem to find any help on the Year to Date feature (unless it's so easy and I'm just 'missing it').  I purchased CR Encyclopedia hoping it would be addressed in the appendix, but alas, it's nowhere to be found.

Please help! It would be genuinely appreciated....

All the best


IP IP Logged
greengo
Newbie
Newbie


Joined: 07 Apr 2009
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote greengo Replybullet Posted: 07 Apr 2009 at 6:34am
Not sure if cyrstal XI has this function but in version 8.5 there is a "YearToDate" function.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Apr 2009 at 7:15am
If that does not work can you explain exactly what you want to appear in the YTD column?
You can use a dateadd to determine the first day of the this year:
 Dateadd ('d',1,(currentdate) - (datepart("y",currentdate)))
 and use that in a formula:
if table.date > Dateadd ('d',1,(currentdate) - (datepart("y",currentdate)))  then value else 0
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