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

Group aggregates

Status
Not open for further replies.

rfisch

IS-IT--Management
May 21, 2002
7
0
0
US
I have a report (CR8) based on detailed transactions of sales (ie Post month, product code, record type [debit or credit], qty, extended amount, customer code...these are the important fields).

After building an SQL based (MSSQL7) crosstab query to flatten out each month into it's own column...

...I have a Crystal Report summarizing each of the 12 months across the report. The report is grouped by Customer, then product, Fiscal Year, then finally record type [debit or credit], showing sub-totals for $ and qty sold for each record type group.

I'm looking for a way to track changes between fiscal years (i.e. percent change this May's gross (or net) sales vs. last May's sales, and dollar amount changes for the same comparison).

I'm guessing I need to build some type of running totals but it's not really a running total.

Can anyone give me a push in the right direction?
 
In your report header place a formula:

whileprintingrecords;
numbervar lastyear :=0;

Then in the group where you have the summary field:

whileprintingrecords;
numbervar lastyear;
numbervar change := Sum ({YOURSUMFIELD})-lastyear;
lastyear := Sum ({YOURSUMFIELD});
change
Andrew Baines
Chase International
 
I'm trying to accomplish the same theory as rfisch, but compare last months data with the current months data. Would the formula be similar?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top