use hahn;
SELECT
  month,
  sum(If(t1.firm_geo = 'Россия',if(t1.dt < '2021-03-01', t1.reward, t1.predict_reward))) AS reward,
  sum(If(t1.firm_geo = 'Россия',if(t1.dt < '2021-03-01', t1.amt, t1.predict_amt))) as amt_cost,
  discount_name
  FROM `//home/search-research/ga/agency_rewards/forecast/v1/report/dashboard/predict_amt_rewards_hybrid` AS t1
WHERE
  t1.dt > '2019-11-03' /*'2021-01-01'*/ AND t1.start_model_date IN ('latest') and t1.firm_geo='Россия'
  GROUP BY t1.dt AS month, t1.discount_name AS discount_name
