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

Can "Total" column be divided into subsections as the rest of columns?

Status
Not open for further replies.

handle1134

Programmer
Jul 20, 2006
24
RO
Hello again :)

The top (columns) of my crosstab looks like this:

Total USA Mexico Canada
2006 2005 2006 2005 2006 2005

Notice that the total is not divided for 2006 and 2005, just the total value.
It should be like this:

Total USA Mexico Canada
2006 2005 2006 2005 2006 2005 2006 2005

and because Total is not a value of the Country column, it is not divided as i want, just Crystal puts the total value.
How can I do this?
(I already use multiple summarized fields, verical, must not change that.)

10x

Crystal Reports XI,
JDBC on Oracle 10 database,
Windows XP.
 
You could do a 'manual crosstab', meaning you'd have to tediously define every total as a running total, but also giving you control over what was shown.

Or you could add the source data again as an 'alias'. Put this as a separate category that can be split by date. Of course Crosstab will still do its own total, which would now be double what you want.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Ok, the 'alias' ideea sounds good. You said to put it as a separate category, and that can be split by date.
But what do you mean a separate category?

Here is how I calculate the country of the record.
I have a table with a field 'ID' witch is a number. And in the crosstab, a column with a formula like this:

if {Table.ID} mod 3 = 0 then USA
else if {Table.ID} mod 3 = 1 then Mexico
else if {Table.ID} mod 3 = 2 then Canada

I tried to make an alias and got Table1 and Table2, withc have the same record. But from here nothing worked.
How can I get my Total field without altering the rest of the table?
 
Sorry, the 'alias' won't work because it is part of the same 'row' as the other details. My mistake.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
If you remove the year column and instead use formulas like the following for your summary fields:

//{@2004}:
if year({table.date}) = 2004 then {table.amt}

//{@2005}:
if year({table.date}) = 2005 then {table.amt} //etc.

...you can then go to the customize style tab->summarized fields->check "horizontal"->check "show labels". This will give you the display you would like, although you will need to edit the text labels for each year to remove the "@" symbol.

-LB
 
Ok, this will probabily work. But I already use multiple summarized fields, vertical. And I need it to stay that way.
The summarized fields must be evluated both in 2005 and 2006.
If only summarized fields could be displayed both on horizontal and vertical...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top