$week = ($date) -> {
    return DateTime::Format("%Y-%m-%d")(DateTime::StartOfWeek(cast($date as Date)))
};

SELECT
    Week,
    SUM_IF(sum_rub_wo_nds, source = 'uac' AND client_crm_tier = 'SB') / SUM_IF(sum_rub_wo_nds, client_crm_tier = 'SB') AS Share
FROM hahn.`home/operanalytics/regular/kermen/Dashboards/UC/Launch/camp_stat`
GROUP BY $week(stat_date) AS Week
ORDER BY Week DESC
