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!

Dynamic Summary with Running Totals 2

Status
Not open for further replies.

CRWriter

Programmer
Feb 16, 2005
9
US
Hi, Crystal Reports 8.5, Oracle 8i
I'm trying to create a dynamic sales summary in the report footer.
DATA:
District Cust SG ProdFam $
AA 11 T P 15
AA 11 V X 10
AA 12 T P 30
AA 13 T P 5

GROUPING ORDER:
1st District
2nd Cust
3rd SG
4th ProdFam

NEED HELP WITH:
creating a summary on ProdFam in the footer of the report.
Where ProdFam is Grouped and Summed, (maybe up to 50 different ProdFam in the report)

RESULTS NEEDED:
ProdFam Sales
P $50
X $10

Any ideas

 
Place a crosstab in the report footer and put the prodfarm as the row, and the sales as the summary.

-k
 
Thanks. I have tried that but I can not get the sum values in to each column. Example, I have PR MO SALES, PR MO QTY, PR MO LBS. They all come out in a list in the crosstab.

 
Sorry, that doesn't make sense to me, please clarify.

Your example data doesn't list those items, so I've no idea what they relate to.

-k
 
Summary Needs to look like this:

Prod Family P1Sales P2Sales P3Sales
P $10 $15 $20
X $15 $30 $60
----------------------------------------
totals: $25 $45 $80

With the cross tab I get these results:

P $10
$15
$20
X $15
$30
$60
 
Within v8.5 of CR, I don't think you can display the summaries across instead of stacked (as they are now.)

You may need to create formulas for each Product Family for each value you're totalling. (will work well if you don't have too many Prod Fams and too many values.)

Eg
@PF-X_PR MO SALES
If {Table.ProdFam}="X" then {Table.PR_MO_SALES}

@PF-X_PR MO QTY
If {Table.ProdFam}="X" then {Table.PR_MO_QTY}

@PF-X_PR MO LBS
If {Table.ProdFam}="X" then {Table.PR_MO_LBS}

@PF-P_PR MO SALES
If {Table.ProdFam}="P" then {Table.PR_MO_SALES}

@PF-P_PR MO QTY
If {Table.ProdFam}="P" then {Table.PR_MO_QTY}

@PF-P_PR MO LBS
If {Table.ProdFam}="P" then {Table.PR_MO_LBS}

Repeat these formulas for each ProdFam

Place the formulas in the Details section and then Sum them in the Report Footer. You'd likely want to suppress the display of them in the Details section, so you may consider creating a Details B section, placing the formulas there, and then suppressing Details B.


Bob Suruncle
 
Thank you Bob,
Is it possible to create a dynamic array on the Prod Fam and still use the method above? Formula placement and such?
 
I don't think you'd be able to create an array and use this setup.
I assume what you mean is that as you read thru the records, you'd add the ProdFam field to the array.
Something like this - (code is untested)
If NOT( {Table.ProdFam} in myarray ) then
(
local numbervar i := count(myarray);
redim preserve myarray [i+1];
myarray [i+1]:= {Table.ProdFam}
)
But then how would you envision accumulating values?


Bob Suruncle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top