Solved

Make a Crosstab display all rows, even if there is a zero total for that row

Posted on 2003-12-02
6
236 Views
Last Modified: 2012-06-27
I cannot find any answers anywhere to this question. I am trying to make a crosstab that will show all rows even if there is no data to display.

My problem is that I need to regually generate a report and export its data to an Excel spreadsheet. If there is no data for a particular row, CR wont display this row at all. So when I export to Excel, the data shifts up or down depending on what records were omited.

An example of what I am trying to do is:

               JAN     FEB     MAR    TOTAL
Age Group
17 and under   6       0       10     16
18-24          0       0       0      0
25-34          1       7       2      10
TOTAL          7       7       12     26

If it doesn't look right, copy and paste it into Notepad. Thanks.
0
Comment
Question by:coultone
6 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 9864111
One or more of these techniquest may be useful for you.  In general, these tend to indicate that you use a formula somewhere in the row to force the row's appearance.

http://support.crystaldecisions.com/library/kbase/articles/c2009392.asp
http://support.crystaldecisions.com/library/kbase/articles/c2011156.asp

Another option would be to add a very small value (0.000001) to your January values, for example, and let the formatting and rounding features in CR take care of suppressing the fractional part.  This would give you a non-zero value which should be displayed.  This may cause problems with Excel export, however.
0
 

Author Comment

by:coultone
ID: 9864182
It is hard to explain. My problem consits of a table containing the field I want the crosstab to show, and a look-up table containing all the fields that that field can contain.

My look-up table contains values such as CD, GF, HG, RF, RS and UM. These are codes that refer to an organisation category. The table that contains the data, may not neccesarily contain an organisation category, but I need the row to appear anyway with the row label and a zero or even "NA"in its place.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 9865459
In general you cannot report on data that doesn't exist.  You need a source table which contains a list of all possible row labels and then link this table to your current table.  If you are using a pc database this will give you the result you want; if its SQL server or some other SQL database then you will need to change the link to a left outer join to pull in all the list values.

Pete
0
 
LVL 3

Assisted Solution

by:kathmacmahon
kathmacmahon earned 250 total points
ID: 9874720
Can you base your report off a stored procedure or query?

What you'll need to do is generate those empty rows as part of your query, something like this:

SELECT ID, NULL AS AGE FROM LOOKUP_TABLE
UNION
SELECT ID, AGE AS AGE FROM DATA_TABLE INNER JOIN LOOKUP_TABLE ON DATA_TABLE.ID=LOOKUP_TABLE.ID
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question