def get_cumulative_count(key):
query = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>table=_RAW_SALES_TABLE,<EOL>year=key.year,<EOL>month=key.month,<EOL>lot=key.lot,<EOL>sector=key.sector,<EOL>sme_large=key.sme_large))<EOL>logging.debug(query)<EOL>result = scraperwiki.sqlite.select(query)<EOL>logging.debug(result)<EOL>value = result[<NUM_LIT:0>]['<STR_LIT>']<EOL>return float(result[<NUM_LIT:0>]['<STR_LIT>']) if value is not None else <NUM_LIT:0><EOL>
Get the sum of spending for this category up to and including the given
month.