 		sum(round(pop_curr * pc_wg * pc_wg_affected * deficit / hh_size, 4)) AS ubpl_deficit
 	FROM
     zaf.demog_sas AS f,
-		zaf.tbl_ofa_outcomes_sas AS g
+		zaf.tbl_ofa_outcomes AS g
 	WHERE
 		  threshold = 'UBPL deficit'
     AND

		round(pop_curr * pc_wg * pc_wg_affected * CAST( deficit > 0.005 AS INTEGER), 0) AS pop_ubpl_def,
		round(pop_curr * pc_wg * pc_wg_affected * deficit / hh_size, 4) AS ubpl_deficit
	FROM
		zaf.tbl_ofa_outcomes_sas,
		(VALUES
				(1, 'very poor'),
				(1, 'casuals'),

;


INSERT INTO zaf.tbl_ofa_outcomes (
  ofa_year,
  ofa_month,
  sa_code,
