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!

Sorting and grouping problem

Status
Not open for further replies.

jesperengel

Technical User
Nov 7, 2005
18
0
0
DK
Using CRvXI,

I have a report with three data fields, which are all grouped.

Then I have a forth "row", which counts the number of shots made with each combination. Each group is sorted in its original order.

Player Club Ball Shots

John Titleist Srixon 4
Peter Titleist Srixon 3
John Cleveland Titleist 6
John Titleist Srixon 2

The way it is sorted now, if the same combination of player, club and ball, has been used multiple times, they will appear in seperate parts of the report, and the number of Shots will therefore be wrong.
If I sort the groups in Descending order I get the total number of shots and no repeated combination. What I need also though is to list the groups in the original order, and repeated combinations to be included the first time the combination appears.

Like this:

Player Club Ball Shots

John Titleist Srixon 6
Peter Titleist Srixon 3
John Cleveland Titleist 6

Can I do that??

Thank you.
 
From the first set of data, it looks as if it hasnt been grouped at all.

What you need to do is create 3 groups:
Player
Club
Ball.

You can supress the group headers and footers for all but Ball and put your Player, Club, Ball and summary field in that footer.

I am not sure if I understood your problem right. Else post the actual structure of your report and what goes into the detail section.

-rrgakanth.
 
You could concatenate the Player, Club and Ball fields together in a Formula.

@Unique Combo
{Table.Player} & {Table.Club} & {Table.Ball}

Group on this formula and sum the Shots field in the Group Footer.
Suppress the Group Header and Details Sections.
Copy the Player, Club and Ball fields into the Group Footer.


Bob Suruncle
 
Try posting what database you're using.

In original order is the rub here, grouping is simple, but grouping is either ascending, descending, or you can manually specify the order, which might work for you.

One way around this would be to key off of a datetimestamp if one exists, or off of a row ID.

Then you can have a query which generates the original order (the 3 fields, not the values), then join a query which has the values to provide summaries.

Again, it's database dependent.

Let's hear if I'm on the right track.

-k
 
Thank you all for your suggestions.

Rrgkanth, the three fields have been grouped and for clarification I will try and give you a better idea of the report setup below.

BobSuruncle, I tried your solution with a unique combo, but ended up in the same place, without being able to sort the data in the right way. I still seem to be missing a way to specify the order as original and at the same have the data grouped together if the same combination comes out twice. As I wrote previously it works perfect if I choose ascending or decending, but I still need to have them sorted in the original order (according to time, with multiple identical entries being summed up the first time the combination appears).

Synapsevampire; I am using an xml file for Visual Studio .NET as well as a schema file. I think you are on the right track with using a timestamp. The source file contains data fields for hours, minutes and seconds, so I assume I can use these. However, I still think I lack another way to specify the sorting order in Group Sorting Order. If I could somehow sort the combo, that BobSuruncle suggested, according to a timestamp!

Anyways, here is how I built my report:

Group 1: Player (sorted original order)
Group 2: Club (sorted original order)
Group 3: Ball (sorted original order)

Details: {Player} {Club} {Ball} Count ({Stroke.IdentifierData.BallType}, {Stroke.IdentifierData.BallType})

GH1, GH2, GH3, GF1, GF2, GF3 (Suppressed)

Again thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top