$week = ($date) -> {
    RETURN DateTime::MakeDate(DateTime::StartOfWeek(CAST($date AS Date)))
};

use hahn;
SELECT
  Week,
  sum(t1.cost_noncommerce) AS cost_noncommerce,
  sum(t1.cost_commerce) AS cost_commerce
  FROM `//home/comdep-analytics/dashboards/noncommerce/effect_stats_by_slice` AS t1
WHERE
  t1.place_id = 542 and
  t1.campaign_type = 'mobile_content'
  GROUP BY $week(t1.dt) as Week
