Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to structure current year/previous year reports

Status
Not open for further replies.

DanaN

MIS
Feb 1, 2006
2
US
I am a new crystal developer, so my apologies for a seemingly simple question. I am using CR XI on XP. I need a date driven report that summarizes data for each product sold then show same sales for previous year period. The user wants a monthly option (calendar) and a weekly option (Mon-Sun).

Right now, I have developed a sum up of the current year period, but I am struggling with which way is best to get previous year. It may just be my approach from a SQL background is clouding my thought process. Any suggestions?
 
If your background is SQL (which type of SQL database?), then you may find it best to create Views or SPs to return the data already grouped.

Since you've supplied nothing technical about how the report should be laid out, it's hard to advise you.

A simple way to provide yearly summaries is to create a Running Total, and in the evaluate->Use a formula place the date criteria, as in:

{table.date} >= cdate(year(currentdate)-1,1,1)
and
{table.date} <= cdate(year(currentdate)-1,12,31)

Or you can group by the years if they are the be in row formats.

If the above doesn't help, post an example of what you need rather than trying to describe it.

-k
 
My real SQL background is in Oracle, but I am currently using DB2. I can think of ways to write a program, but all of them require input parameters to get the correct sums which essentially would prevent the enduser from being able to just run the report, so I really want to work this out within Crystal.

Here is what I have:

item item desp avg. price gross margin$ gross margin
123 flower $4.32 $3.20 7.4%
(item) (descp) (w. avg on qty) (gross sales-prod cost) (gross margin/gross sales

I essentially hid the detail and have these items summarized on the group header. I need the same information on these products for the same period previous year in the same report.

Does that make sense?

I have entertained a bunch of different ideas, but I am not yet proficient enough with the tool to determine a good path to the numbers. A running total would be great, but is there a way to group it by a field such as product number?
 
Makes sense, so you want it displayed above or below the current row?

Just group by the date (use the for each year) and you're existing summaries should be fine.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top