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!

How to get the count for the Number of Groups

Status
Not open for further replies.

cmsgil

Technical User
Oct 26, 2004
9
US
I am using Crstal Reports v8.0.

I am creating a report where I have to calculate Averages per Day , Week and or Month in one report. The number of Days, weeks or months can vary based on the date search the user selects. I have created three groups from a Date Time fields to one to print for each Month, Week, Day. There are 3 other groups that will actuall show on the report. I need to count the number of Day Groups there are to calculate and average per day.

I tried using the GroupNumber field but that only numbers the groups. I need for example the total number of groups for a given date range.

If the user inputs 11/1 thur 11/30 and the only valid dates in the table are 11/3 and 11/5, I want to use the number 2 which would be the number of Day Groups to calculate an average # or pacakge shipped for the date range input.

Whew~!!!!!
 
Insert a group by Month
Insert a summary with a distinct count on dates

DATE

11/3
11/3
11/5
11/5
11/5


Count = 2
{distinct
 
Insert the special field 'groupnumber' in the rport footer and it will tell you how many groups you have.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
I don't need the total number of groups in the report, i need the total number of groups per group.
 
I have created three groups from a Date Time fields to one to print for each Month, Week, Day. There are 3 other groups that will actuall show on the report. "

What are these 3 other groups, and where are they in relation to the dates? This may seem intuitive to you, but your description gives no indication.

As an example, if you want the number of widgets by day, week and month, than you would group by

GH1 Widget
GH2 Month
GH3 Week (Work week has no relation to months)
GH4 Day
Details <place the widget qty field, right click it and select insert->summary->Average->For All Groups>

All groups will now have the average number of the qty of widgets for that periodicity.

Perhaps if you demonstrate data examples and expected output it will help. Think of posting like building a mini-spec, developers need technical information.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top