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

Re: Columns in Crosstab - displaying zeros for no data 1

Status
Not open for further replies.

Harki06

Technical User
May 18, 2006
85
US
Hi,

I am using Crystal Reports Advanced Developer v10. My table has case number, case year, date and case type. In the crosstab, rows - I display case type and columns I display count of cases for each calendar quarter. If there is no data, the column for which there is data is displayed. I cannot do a join since it is the same table. So will I have to do a mock crosstab?

Thanks!
 
I did find a formula that works. Create a formula for the summarized field section. If {field.field} = 1 (or any true condition) then 1 else 0. Do a sum on this formula in the summarized section, and the columns without data will be displayed with a '0' in the summary.
 
I tried this as a formula and did a count of the same but it did not help. If {MCTCase.Case_Number} > 0 then 1 else 0

What am I doing wrong?
 
Does anyone have a suggestion to this problem??? The value does not exist do there is no zero value. Where should this be placed?
 
Do you want zeros to show up? My guess is that your info is coming back as null if there is no info. You will have blank data if it tries to count them. You can either change the whole report to use default values for null or create a formula which returns the field you want and use default values just for the formula. add those to your crosstab instead of the actual field.

This is all assuming I understand what you are trying to accomplish.
 
The problem isn't 'columns with no data' but just 'no data'.
If there is no data there will be no column. If you can't generate a record for each column then you will have to use a mock cross-tab.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Yes, I have no data and that is the problem. Guess I have to use a mock cross tab.
 
How do I create a mock cross-tab? I tried creating a running total but I have a list of clubs and for each club I want a cross tab for 4 quarters.
 
See Items 10 - 12 on this link:

If you group by club you should only need 4 formulas or 4 running totals, one for each quarter.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
When I put conditions, the condition would not give 0 since there is no data in the database. It is only gives 1 when there is data. I grouped by club and then by each quarter.I will try item 12 and let you know.
 
Don't group by quarter. You need one formula and one subtotal for each quarter.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
It worked using mock cross tab and your solution. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top