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

Ability to Show Column Displaying Last Year's Data

Status
Not open for further replies.

TheBig1980s

IS-IT--Management
Jun 11, 2007
60
I'm using Crystal XI that shows inventory items in one column, along with this month's sales dollar figures in another column.

I need another column that shows last year's sales figures from this month (i.e. sales at this same time last year).

I have been unable to make use of shared variables from the subreport that I created showing last year's data. The variable, first of all, returns 0.00. Besides that, I do not see a way to pull inventory items from the subreport onto the main report when the main report shows those items already. (In other words, some of the items from last year on the subreport may already be on the main report, some may not be.) I would need for all inventory items to show on the main report along with sales figures from this year and last year, whether the items were sold last year or this year.

Does Crystal have the ability to display columns of data based on points in time?

TheBig1980s
 
YOu will need to add in a table listing all your inventory items. Then join your existing data as a left outer from this new table. This will allow your main report to list all inventory items whether or not a sale has been made.

YOur subreport must execute for each item and in the appropriate group footer. It would just be a simple report showing the summary data you want for that month and inv item.

You will link SR on Inv Item and the date range params your are using in main report. YOu will need to add similar date range params to SR. To link params. In SR link box, slect param from main report and in lower left hand drop down slect corresponding SR param.

In subreport change select statemment to find last years date

eg

yourdatefield >= dateadd("yyyy", -1, {your startdateparam})
and
yourdatefield <= dateadd("yyyy", -1, {your enddateparam})

Ian
 
But, I need for the report to be columnar. It needs to match the format of a report that they used in their previous system.

Will this allow for this?

TheBig1980s
 
Yes

It will be slow to execute as the last years data will always be the result of a SubReport. YOu just make the SR the same size as a datacell.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top