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

comparative report

Status
Not open for further replies.

JSHoltsIT

IS-IT--Management
Apr 12, 2007
66
US
I have a report that pulls data from both a date period in the current year and the same period last year.

I would like the report to display by day with the current date range ascending on the left with last year's data on the right.

Currently, my report is
daily_compare_sales_report.jpg


What programming magic do I have to conduct to align the respective dates and ultimately pull data from those days (order count, net sales, profit, etc).

The select statement I use to bring both periods in is
(
{V_Sales_History_w_Ecomm_Attributes.glpostdt} = {?Date Range} or
{V_Sales_History_w_Ecomm_Attributes.glpostdt} in dateserial(year(minimum({?Date Range}))-1, month(minimum({?Date Range})), day(minimum({?Date Range}))) to
dateserial(year(maximum({?Date Range}))-1, month(maximum({?Date Range})), day(maximum({?Date Range})))
)

TIA

Jason
 
You should insert a crosstab that uses the date field as the column field->group options->print on change of year, with the summaries desired: order count, net sales, etc. If you are trying to compare year by day, then create a formula for your row field:

totext(month({table.date}),"00")+"/"+totext(day({table.date}),"00")

If you want to display the row field differently, then while the row formula above is selected in the crosstab expert->group options->customize name->use a formula:
totext(month({table.date}),"M")+"/"+totext(day({table.date}),"d")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top