Hi
Create running totals
Go to Filed Explorer Menu View --->Field Explorer
Then Select running totals node create new running total field
Then use the settings below
Select Filed to summarize ----any numeric field such as Id or primary key id field
Select Type of summary :-Count
Evaluate - Select for each record
Reset - On Change of Group i.e Math ,Chemistry
Place the running total field against Alegbra,Statistic .....
That should work
cheers
Rahul