Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crosstab and multiple summary rows for each row Post Reply Post New Topic
Author Message
pshirvan
Newbie
Newbie


Joined: 01 Aug 2012
Location: United States
Online Status: Offline
Posts: 2
Quote pshirvan Replybullet Topic: Crosstab and multiple summary rows for each row
     Posted: 02 Aug 2012 at 6:56am
I have a customer table and a salesrep table and I am trying to create a report that shows the count of new accounts, base on the date created, per sales rep. grouped by monthly columns and display the current year and the previous year's summary totals rows on top of each other for each sales rep. as follows:
 
                    Jan   Feb  Mar  Apr  May  Jun  July  Aug  Sep  Oct  Nov Dec  Tot
 
Rep1 (2011)    1      0     3      2     5      0      6      4     2      1     1     0    25
         (2012)    0      2     1      0      0      1     1      2     3      5     1     2
   .
   .
RepN (2011)    1      0     3      2     5      0      6      4     2      1     1     0    xx
         (2012)    0      2     1      0      0      1     1      2     3      5     1     2
 
Total               x       x      x     x                                                                 xx
 
I have tried different ways but can't get the rows for the years to show the current and prior years rows either lined up properly or count correctly.
As a work arount I created two crosstabs, adjusted the size, position and alignments and superimposed them but it worked for the first  page only and on subsequent pages they were messed up.
I also tried creating Commands (one for each year) in the Database Expert but could not get it to work either.
If the report designer cannot handle this then the solution could be in the
data source preparation.
 
 Any ideas or suggestions would be grealty appreciated
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Aug 2012 at 7:21am
crosstab
set row on rep
set a second group on account creation date set to group at the year
create a formula field to extract the month from the account creation date
 
totext(month(table.creationdate),'00',0,'') + monthname(month(table.creationdate),TRUE)
use this as your crosstab column
summarized field is the distinctcount fof the account id
IP IP Logged
pshirvan
Newbie
Newbie


Joined: 01 Aug 2012
Location: United States
Online Status: Offline
Posts: 2
Quote pshirvan Replybullet Posted: 02 Aug 2012 at 11:04am
Thank you for the quick response. It worked like a charm. I was able to get the exact output I was looking for.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum