I have the following tables / data:
COMPANT_T ( 1 record ) :
company_tid ( 1 )
comp_name ( NAMI, LTD )
…
STATS_T ( 2 records ) :
stats_tid ( 1, 2 )
company_tid ( 1, 1 )
stats_origin ( John, Maria )
STATS_DETAILS_T ( 4 records ) :
stats_details_t ( 1, 2, 3, 4 )
stats_tid ( 1, 2, 2, 1 )
company_tid ( 1, 1, 1, 1 )
year ( 2005, 2005, 2006, 2006 )
amount ( 1000, 10000, 9000, 20000 )
agg_amount ( aggregate sumarizing amount - SUM )
I display the data in a company form with nested tab panels (company → stats → stats_details).
The relations are:
company_TO_stats (company_t.company_tid = stats_t.company_tid)
stats_TO_stats_details_BY_company_tid (stats_t.company_tid = stats_details_t.company_tid)
The problem is that the tab panel shows two lines. One for each year, both with a agg_amount of 21.000, but my objective is to have two lines with the total for each year:
2005, 11.000
2006, 29.000
I realize I still have to discriminate across the years, but there’s no sense trying to figure that out when I sure it’s a pretty standard problem with a straigh forward answer.
Any tips
Miguel