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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same Period Last Yr

Status
Not open for further replies.

mfroggie

Vendor
Jan 22, 2002
44
US
I am trying to write a report that has sales for a certain period and the next column to have sales for same period last year. Can't seem to come up with it. Can anybody help? Thanks

Mfroggie
 
I didn't make that very clear. I can't figure out the formula to get the sales for same period last year. Using CR 7.0 for this report. Thanks

Mfroggie
 
Maybe your second column could be a sub-report, just pass in the parameters you need and the adjust date range...

Paul Wesson, Programmer/Analyst
 
What period is it?

It sounds like you can just use a Cross-Tab with the date as year in the column, the field to summarize in the summarized fields, and sorted the date descending.

-k
 
If you are using date parameters for the start and end dates, you could do something like the following:

First, for your record select statement, use something like:

{table.date} in Date(year({?start})-1, month({?start}), day({?start})) to {?end}

Then for this year's performance period, use:

if {table.date} in {?start} to {?end} then {table.sales}

For last year's performance period, use:

if {table.date} in Date(year({?start})-1, month({?start}), day({?start})) to Date(year({?end})-1, month({?end}), day({?end})) then {table.sales}

You can insert summaries on these to obtain results at any group level you may have.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top