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

Main Report Group Sum of Shared Variables from SubReports 1

Status
Not open for further replies.

seallan

MIS
Oct 9, 2001
1
0
0
CA
I have two subreports that generate two different commisions per invoice (one at the invoice level; the other at the line item level for multiple products within an invoice). I have been able to create shared variables to add the two commissions together in the main report in a section of the detail. This gives me a total commission per invoice.

The sort order of the report is by Sales Rep and then by invoice. I then want to generate a total commission per sales rep for all their respective invoices. I am not able to do this. When I try to create a new function variable that is the sum of the invoice commission total, I get an error saying that the sum/running total variable could not be created.

Any help would be greatly appreciated. I have few hair left!

Susan
 
perhaps using arrays will help...I often do this.

Are the subreports linked or unlinked???

I use unlinked subreports myself mostly when the data set is reasonably small

then use a shared array to pass the values back to the main report

for example a string array could be

salesrep code |invoice no|commission

each array element (1000 elements max, 254 chars/element)would have a set no of characters/info
eg sales rep = 10 characters
invoice no = 5 characters
commission = 8 characters

the subreport is set in the report header to run before the main report so the data is ready.

then in the main report a formula parses out the info you need.

Give you any ideas???

Jim
 
I have a similar question, I am grouping a series of diagnoses by medical record number (patient). I then have a formula that reports whether the person ever had asthma and another procedure. At the group level, each patient has a numeric for "has asthma" (at any time) and a separate formula resulting in a numeric for the other procedure. All this works fine.

The problem: I am now trying to create a cross tab for an "odds ratio" that uses the two summary formula of the details for each patient.

The cross tab only reads the individual detail records, not at the higher summary level for my "distinct patient".

Any one have any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top