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

Cumulative running totals in crosstab not resetting on change of group

Status
Not open for further replies.
May 24, 2010
2
GB
I'm using CR10.

I'm trying to create a crosstab that shows the number of discharges per client per month and also cumulatively over the course of a year.

I've created a crosstab as per lbass's post here:


which works brilliantly but I can't get it to reset on change of group, the cumulative function keeps running.

I've tried placing a reset formula in the group header and that doesn't do anything.

Can anyone help please?!

Many thanks,

Laura
 
Please identify the fields you entered in the crosstab expert for row, column, and summary, and explain what should be accumulating. Maybe show a little sample data of what you expect the crosstab results to look like.

-LB
 
Ok, no probs.

I have a discharge reason string in my row and date of discharge in my column (displaying monthly so I have 12 columns for the last year). My summary is a count of something called a client attributor which is a combination of letters and numbers which anonymises our client data.

The data is sent through from various organisations so I've grouped by organisation. What I need to see is the cumulative number of discharges throughout the year for each agency. Using the methodology you applied to a previous question I've managed to get the numbers to run cumulatively but I can't get them to reset on change of group.

My data currently looks like this:

Apr-09 May-09 Jun-09 Jul-09 Aug-09 Sep-09 Oct-09 Dec-09 Jan-10 Mar-10
Incomplete - dropped out (number) 1 2 4 3 2 1 0 0 0 3
Incomplete - dropped out (cumulative) 1 3 7 10 12 13 13 13 13 16
Incomplete - retained (number) 0 0 1 0 0 0 0 0 0 0
Incomplete - retained (cumulative) 0 0 1 1 1 1 1 1 1 1
Treatment completed (number) 2 1 2 2 2 2 2 0 1 5
Treatment completed (cumulative) 2 3 5 7 9 11 13 13 14 19
Total (number) 3 3 7 5 4 3 2 0 1 8
Total (cumulative) 3 6 13 18 22 25 27 27 28 36

And at the moment what's happening is that, for the next group, the cumulative total is starting at 36 and adding on from there.

That probably doesn't look very good but hope you can see what I mean!

Any help would be greatly appreciated!

Laura
 
Are you saying the crosstab is PLACED in a group section and that the cumulative results are continuing in the next group? If so, then place a reset formula in a group footer. Not sure what your variable names are, but use a formula something like this:

whileprintingrecords;
numbervar curr := 0;
numbervar tot := 0;

If the crosstab is in a group footer section, place the reset in a suppress GF_b section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top