?
Solved

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

Posted on 2003-12-02
6
Medium Priority
?
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 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 1000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

800 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