Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Empty crosstab rows Post Reply Post New Topic
Author Message
PSRS
Newbie
Newbie


Joined: 19 Jul 2012
Online Status: Offline
Posts: 5
Quote PSRS Replybullet Topic: Empty crosstab rows
     Posted: 19 Jul 2012 at 2:05pm
Is there a way in Crystal Reports 2008 to print the row in a crosstab when the counts are zero?
 
For example, if I have rows for types of cars (Ford, Chevy, Hyundai) by (columns of) months, and there were no Fords to count in any months, the whole row will not show up. 
 
It is particularly troublesome when you are just beginning a year.  If there were no Ford's in January, the Ford row will not show up.  If there was a count for Fords in February, then the row will show up and there will be a zero for January.
 
Thank you for any help you can provide.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Jul 2012 at 1:51am
Usually you need a source table that has all of the months or calendar days in it, then you outer join it to your other table.
Then in your cross tab you group on the calendar table.

Edited by DBlank - 20 Jul 2012 at 1:51am
IP IP Logged
PSRS
Newbie
Newbie


Joined: 19 Jul 2012
Online Status: Offline
Posts: 5
Quote PSRS Replybullet Posted: 20 Jul 2012 at 12:16pm
Thank you very much.  I'm still trying to get it to work. 
 
Would the outer join be from the data table to the Months table or from the Months table to the data table?
IP IP Logged
PSRS
Newbie
Newbie


Joined: 19 Jul 2012
Online Status: Offline
Posts: 5
Quote PSRS Replybullet Posted: 20 Sep 2012 at 12:20pm
DBlank,
 
Thank you for your assistance.  We have created our source table and created a left outer join from it to our other table.  We then grouped both fields in the crosstab, adding in the missing categories into the grouping under specified order.  We still don't get a row for the missing data or a column for the missing month. 
 
Can you provide any additional assistance?  Thank you very much.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Sep 2012 at 5:06am

Make sure in your select statemtn you are using the "calendar" table and in the crosstab make sure youa re grouping onm the calendar table.

If you used the "car" table in either instance it would still omit the zeros.
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