[yaala] problems with TOTAL

qMax yaala@verplant.org
Mon, 10 Mar 2003 23:09:03 +0600

This is one thing that confuses me abit.
Aggragation of TOTAL(foo) works just like SUM(foo),
but grouped and arranged separately:
- it is grouped not for all keys given in grouping (arrangament), but
  for subset of them,
- it is arranged not among other aggregations (which would repeat the
  value), but whithin KeyValues, in rows normally.

In yaala up to 0.5 these values were calculated in report module,
which is definitely wrong.

I see one rough solution for this - introducing another Definition property
'subgrouping', applied with operator BY:

    SELECT SUM(bytes) AS "Amount",
           SUM(bytes) BY client AS "Total for client"
           FOR client, server, whatever;
This will put second SUM(bytes) into separate database table
(indexed with only 'client') but include it into the same report
table and arranged under each client name.

This is very rough and makes it not clean in what columns (DataVars)
to put this value.