def define_calculated_statistic(name, &block)
      method_name = name.to_s.gsub(" ", "").underscore + "_stat"

      @statistics ||= {}
      @statistics[name] = method_name

      (class<<self; self; end).instance_eval do
        define_method(method_name) do |filters|
          @filters = filters
          yield
        end
      end
    end
def define_calculated_statistic(name, &block)
      method_name = name.to_s.gsub(" ", "").underscore + "_stat"

      @statistics ||= {}
      @statistics[name] = method_name

      (class<<self; self; end).instance_eval do
        define_method(method_name) do |filters|
          @filters = filters
          yield
        end
      end
    end
Defines a statistic using a block that has access to all other defined statistics

 EXAMPLE:
 class MockModel < ActiveRecord::Base
   define_statistic "Basic Count", :count => :all
   define_statistic "Basic Sum", :sum => :all, :column_name => 'amount'
   define_calculated_statistic "Total Profit"
     defined_stats('Basic Sum') * defined_stats('Basic Count')
   end