 		'(CASE WHEN (thr_eligible_child + thr_eligible_ccs) = 0 THEN 1 ELSE (thr_eligible_child + thr_eligible_ccs) END)) >= 0.5 THEN 10 ' ||
 		'ELSE 1 END';
 
-    -- haven't looked at this query yet
 	-- Pass to calculate awc score and ranks
 	EXECUTE 'UPDATE ' || quote_ident(_tablename) || ' SET (' ||
 		'awc_score, ' ||

	all_text = 'All';
	null_value = NULL;

    -- should there be indexes created on this table?
    -- it doesn't appear to be filtered in this file. maybe tableau touches it?

	EXECUTE 'INSERT INTO awc_location (SELECT ' ||
		quote_nullable(all_text) || ', ' ||
		quote_nullable(null_value) || ', ' ||

		'WHERE month = ' || quote_literal(_start_date) || ' AND caste != ' || quote_literal(_all_text) || ' GROUP BY awc_id, month) ut ' ||
	'WHERE ut.month = agg_awc.month AND ut.awc_id = agg_awc.awc_id';

	-- Pass to combine THR information from ccs record and child health table
	EXECUTE 'UPDATE ' || quote_ident(_tablename) || ' SET thr_score = ' ||
	'CASE WHEN ((thr_rations_21_plus_distributed_ccs + thr_rations_21_plus_distributed_child)::numeric / ' ||
