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

Date Tables and Mock-Crosstabs

Report Development

Date Tables and Mock-Crosstabs

by  Madawc  Posted    (Edited  )
This topic keeps coming up: someone wants an entire ranged of dates to show even when there is no data for it. Or occasionally some other variable, but the solution is similar.

Stage One
If groups A, B and C cover all of the possibilities between them, then you can do a crosstab. These are quick and easy ways to group data in ways that can be different from the main group.
It's worth learning about crosstabs as a general quick solution, even if they do not help with your immediate problem.
Note that crosstabs can be edited to look quite different from the tabular entity that you get as a default

Stage Two
Are you able to get tables / datasets added to the database? If you got a table of DATE set up, this could be linked to the activity using LEFT OUTER and you'd still get a slot when there was no activity. (But note that any selection on the second table must do an IsNull test first, otherwise you'll not get the dates with no records, null value for the second record.)

Stage Three
If you can't add a table, you'll be stuck with creating a 'Mock Crosstab'. Crosstabs are fine if you don't mind the absence of rows or columns with no data, but you said you wanted empty slots to show.

A 'Mock Crosstab' is something that looks like a Crosstab, but in fact you define each column yourself, normally as a running total. This would need to go in the report footer, because running totals count as the reports 'run' and they will not be complete until then. Crystal should have included an example along with the Crosstabs.

You can save a little time by doing a paste to a dummy report, changing the name and then pasting back. In Crystal 11.5, you can also duplicate formula fields using the Field Explorer.

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top