Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Current & YTD columns Post Reply Post New Topic
Author Message
kkemp
Newbie
Newbie


Joined: 05 Nov 2008
Online Status: Offline
Posts: 3
Quote kkemp Replybullet Topic: Current & YTD columns
     Posted: 12 Dec 2008 at 7:53am
Help for a newbie!
 
I am creating an accounting report that needs to have columns showing CURRENT PERIOD values and columns showing YTD values.
 
Basically it would look like:
 
                     Current Period                YTD
                   Amount   Budget      Amount  Budget
Dept 1               $           $                 $          $
Dept 2               $           $                 $          $  
Dept 3               $           $                 $          $   
TOTAL                $           $                 $          $
 
the report is using one Oracle View to get the data. the data is stored by year, by period. in other words the table looks like:
 
FINANCE DATA
      year
      period
      amount
      budget
 
i have set the report up so that the user enters parameters for Year and for Period.
 
i built the Current Period columns first and this works great.
 
now I'm stuck on how to go about adding the YTD columns. it seems like this would require a totally separate query etc.
 
help!
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Dec 2008 at 6:17am
Yeah, I would have to agree, you don't have enough information at present.  Can you modify the view to return YTD? That would be one option, or you could create a stored proc would do the same thing querying the view.  All of my reports run off of stored procs and that is where I calc the YTD values.
IP IP Logged
theBlueFrog
Newbie
Newbie
Avatar

Joined: 22 Apr 2008
Online Status: Offline
Posts: 8
Quote theBlueFrog Replybullet Posted: 15 Dec 2008 at 7:47am
You could change your Record Selection Formula to return all rows in the current financial year up to the period selected.

Then display the current period on the group footer, put the individual row (period) figures on each detail line (but suppress the detail line), and use a Running Total to tot them up onto the Group Footer (or just a Summary will do).

Place at the side of the Period values on the Group Footer.


Ought to do the trick, I think...


It would depend on the context of data required.  If someone ran a report for a period which closed 2 months ago, what YTD figure would they want to see?   The YTD up until now, or the YTD up until that period?

The latter, I would think.  Making it a snapshot of that moment in time including that moment's YTD.

In which case my suggestion ought to work. But if doing this in a view and you create one YTD figure, in that scenario of going back in time, the report would present a false YTD figure.

If requiring the 'snapshot' scenario in a view, you'd need to transpose your view such that it would contain a field for each period of a single Department within a Financial Year.

Then in the report you'd create formulas for each period, which would be zero if the period was not included, use the field value if the period was included.  Show the desired Period on the Details line, and add the previous ones to that in another formula field to calculate the correct YTD.


Hope that makes some kind of sense!



Edited by theBlueFrog - 15 Dec 2008 at 7:51am
Anton Wilson
Microsoft CRM Consultant &
Crystal Reports specialist
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