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!

How to insert cumulative total row in cross tab 1

Status
Not open for further replies.

gvg356

Programmer
Mar 22, 2012
17
US
I have cross tab table in the following format

row1 3 4 5
row2 2 3 4
total 5 7 9
cumulative 5 12 21
total

cumulative total is 5, (5+7),(5+7+9)

Can anyone help me in generating the cumulative total and how can I insert into cross tab...
 
You need to identify your row field, column field (if there is one) and your summary field, as shown in the crosstab expert. It would be helpful if you used actual field names.If they are formulas, please show the content. Also please identify your CR version.

-LB
 
Thanks for your reply. My version is crystal report 11
Day Jan Feb Mar Apr May...........Dec
1 2 3 3 3 3
2 3 4 3 2 2
3 2 2 2 3 4
.
.
.
31 1 1 1 1 1
Total 8 10 9 9 10
Cumulative total 8 18 27 36 46
I need the cumulative total row in the bottom of cross tab..I am not using any formulae as total is calculated by crosstab.

Please help me in 2 conditions.
1. how to calculate the cumulative total
2. how to append the cumulative total to cross tab
Thanks
 
I was looking for the database fields used in the crosstab expert, as row, column, and summary field--not another display of results. Also need to know the type of summary--count? sum?

-LB
 
I am sorry....for rows I used database field command.days for columns it is command.monthname and the values are command.total so summary is sum(command.total).
 
Add the summary field a second time, again using a sum. Then select the inner cells (for days)->right click->format field->suppress. In design mode, resize the suppressed summary to minimize the height, by drawing the bottom border up.

Next select the newly created second summary in the total row, and right click->format field->suppress->x+2->and enter:

whileprintingrecords;
numbervar x := x + currentfieldvalue;
false

Then in the same format screen, select "Display String"->x+2 and enter:

whileprintingrecords;
numbervar x;
totext(x,0,"")//0 for no decimals, "" for no comma divider

You can also edit the "Total" label by adding a return and entering "Cumulative".

-LB
 
Thanks for your reply. I need both cumulative total and total as well..and cumulative total should be row underneath the total..Thanks
 
Thanks for your reply. I need both cumulative total and total as well..and cumulative total should be row underneath the total and it should have 12 columns similar to total row but the values should be like in
Jan column the value is 8
Feb column it should be 8+10=18
Mar column 18+9(previous cumulative total+current total)
.......
..Thanks
 
That's what my solution gives you. Did you try it?

-LB
 
I tried it but I did in the wromg way I guess I am getting the sum(total) as single cell. I have a doubt
"In design mode, resize the suppressed summary to minimize the height, by drawing the bottom border up" I am not supressing any summary field except the days column...Thank u very much

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top