TClientDataSet Aggregate questions

2008-02-01 11:31:59 PM
I am trying to work my way around nested TClientDatasets to see if
they do what I need them to. I am building a small league application
as an example.
I currently have 2 TClientDataSets:
1) Matches, containing fields for:
Date, Time, HomeRef, HomeName, HomeScore, AwayRef, AwayName,
2) Teams, containing:
Ref, Name
Matches looks up its names from Teams and all is well. What I am
having problems with is getting aggregate information for the tables.
I would like to find from the Matches table the count of all the
matches played per team, and the goals for / against for each team.
Am I right in thinking that these aggregate fields will need to be on
set on the Matches dataset? And will I need interim fields to get to
where I want (e.g. GoalsForHome, GoalsForAway)?