Should do the trick:
// lets assume the typed view is called PurchasesTypedView
// We can't use Fill() as that routine grabs their own set of fields and we have to adjust the fields
// so we'll create two dynamic lists, using the typed view's fields
ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(PurchagesFieldIndex.OrganisationID, 0, "OrganisationID");
fields.DefineField(PurchagesFieldIndex.PurchaseID, 1, "NumberOfPurchases");
// first run, count purchases per organisation
DataTable purchagesPerOrganisation = new DataTable();
fields[1].AggregateFunctionToApply = AggregateFunction.Count;
GroupByCollection groupBy = new GroupByCollection();
groupBy.Add(fields[0]);
TypedListDAO dao = DAOFactory.CreateTypedListDAO();
dao.GetMultiAsDataTable(fields, purchagesPerOrganisation, 0, null, null, null, true, groupBy, null, 0, 0);
// second run, count organisations per purchase. I create a new set of fields as the order of fields differs
// but you don't have to do this.
fields = new ResultsetFields(2);
fields.DefineField(PurchagesFieldIndex.PurchaseID, 0, "PurchaseID");
fields.DefineField(PurchagesFieldIndex.OrganisationID, 1, "NumberOfOrganisations");
DataTable organisationsPerPurchase = new DataTable();
fields[1].AggregateFunctionToApply = AggregateFunction.Count;
groupBy = new GroupByCollection();
groupBy.Add(fields[0]);
dao.GetMultiAsDataTable(fields, organisationsPerPurchase, 0, null, null, null, true, groupBy, null, 0, 0);