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

Grouping by Week Manually

Status
Not open for further replies.

khdavis

Technical User
Mar 27, 2002
22
US
Hi! Can anyone offer assistance? I'm using Crystal 10 connecting to an Oracle database.
I need to create a month to date report, grouped by week. Each week the report runs would add an additional week of data to the report until the end of the month.
I've been unsuccessful getting it to work as a cross tab because of the different types of information I need to display in the rows.
The report should look like this:

Wk1 Wk2 Wk3 Wk4 Wk5
Total SEV1s
Total Users
Total Bus Impact
Total Impact Dur

I'm at a total loss on how to manually group each week? Is this possible? Can anyone assist? Thanks in advance!

 
For each of the weeks create a formula such as:

IF [some condition that evaluates to TRUE for Wk1] then [some Value you wish to total] ELSE 0

Then, just total that formula.

I'm not convinced you can't use a CrossTab but you don't provide enough information to allow an informed opinion.

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Additional information:

I'm querying an incident management database (Help Desk tickets.)

Total SEV1s = Count of tickets opened in week (field)
Total Users = Sum of Users Affected (field)
Total Bus Impact = Sum of Bus Impact (field)
Total Impact Dur = (Calculation)

I need these numbers for each week. Each week goes from Sunday to Saturday. Calcuating the numbers is not a problem, getting them to align with the appropriate week is. Thanks again.
 
Have you tried inserting a crosstab, using your datefield as the column->group options->print on change of week, and then using no row field, but adding the four fields to total as summary fields? This should work unless your calculation doesn't appear as an available field or unless you are actually looking for cumulative values each week.

In any case, if you need to use a manual crosstab, you could create a formula that numbers your weeks from 1 to 6, based on the week of the month {@weekno}:

datepart("ww",{table.date}) - datepart("ww",{table.date}-day({table.date})+1)+1

Then you could create individual formulas per column, as in:

if {@weekno} = 1 then 1//to sum for a count

etc.

-LB
 
Thanks for your help! I was able to use the crosstab. I also used the info you provided in another thread to add the row labels and it worked great! Thanks again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top