 	_blank_value = '';
 	_no_text = 'no';
 	EXECUTE 'SELECT table_name FROM ucr_table_name_mapping WHERE table_type = ' || quote_literal('ccs_record_monthly') INTO _ucr_ccs_record_table;
-	_aggregation_delay = ($1 + INTERVAL ' - 4 DAYS')::DATE;
 
 	EXECUTE 'INSERT INTO ' || quote_ident(_tablename5) || '(SELECT ' ||
 		'state_id, ' ||

		'sum(lactating_all), ' ||
		'sum(pregnant_all) ' ||
		'FROM ' || quote_ident(_ucr_ccs_record_table) || ' ' ||
    'WHERE state_id != ' || quote_literal(_blank_value) ||  ' AND month = ' || quote_literal(_start_date) || ' AND (add IS NULL OR add <= ' || quote_literal(_aggregation_delay) || ') ' ||
		'GROUP BY state_id, district_id, block_id, supervisor_id, awc_id, month, ccs_status, trimester, caste, disabled, minority, resident)';

	EXECUTE 'CREATE INDEX ' || quote_ident(_tablename5 || '_indx1') || ' ON ' || quote_ident(_tablename5) || '(state_id, district_id, block_id, supervisor_id, awc_id)';

	_null_value = NULL;
	_blank_value = '';
	_no_text = 'no';

	EXECUTE 'INSERT INTO ' || quote_ident(_tablename5) || '(SELECT ' ||
		'state_id, ' ||
