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

Weekly count needed... How to group it? 1

Status
Not open for further replies.

bloomlight

IS-IT--Management
Jun 12, 2006
149
US
I am using Crystal report 10. and need a report which will show total visits of each week. the report will look like this:

week of 11/29/09-12/05/09, total visits 20
week of 12/06/09-12/12/09, total visits 32
......

How to ask crystal report to group by a week, starting Sunday to Saturday? Thanks.
 
Insert a group on the date field, and select 'the section will be grouped by weeks'.

Dana
 
Now, the report shows all the visits and then the total visits. It produce 70+ pages. How to ask crystal report to show "summary" data only, not the "details"? Thanks.
 
Go into the section expert->details->suppress.

-LB
 
One more question: how to get subtotal and total for each week. The manager asked if the report could be formatted as the following:

week of 11/29/09-12/05/09, total visits 20
visit reason A: 5
visit reason B: 10
visit reason C: 5

week of 12/06/09-12/12/09, total visits 32
visit reason A: 20
visit reason B: 10
visit reason C: 1
visit reason D: 1
......

Now, my report looks like this:

week of 11/29/09-12/05/09
visit reason A: 5
visit reason B: 10
visit reason C: 5

week of 12/06/09-12/12/09
visit reason A: 20
visit reason B: 10
visit reason C: 1
visit reason D: 1
......

I used group for visit date and choose "the section will be printed for each week". But don't know how to make sum (total visits) of the week? Any idea?


 
Right click on your visit ID field and insert summary->count->week group level.

-LB
 
Now, I need to make a query which only shows "the weekend visits" from 01/01/09 to 12/31/09. How to group weekends?
Thanks.

The report would look like this:

weekend#1: 01/03/09 - 01/04/09

visit reason A: 5
visit reason B: 10
visit reason C: 5

weekend#2: 01/10/09 - 01/11/09

visit reason A: 2
visit reason B: 25
visit reason C: 4

weekend#3: 01/17/09 - 01/18/09

visit reason A: 10
visit reason B: 3
visit reason C: 5





 
First create a formula like this:

{table.date}-dayofweek({table.date},crSaturday)+1

Insert a group on the above formula on change of date (not week). Then replace the groupname with a formula:

whileprintingrecords;
numbervar cnt := cnt + 1;
"Weekend #"+totext(cnt,0,"") + ": " +
totext({table.date}-dayofweek({table.date},crSaturday)+1,"MM/dd/yy")
+ " - " + totext({table.date}-dayofweek({table.date},crSaturday)+2,"MM/dd/yy")

In your selection formula, use:

dayofweek({table.date}) in [7,1]

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top