use hahn;
PRAGMA dq.AnalyzeQuery = "1";

Use hahn;
$find_day=($date, $delta_day) ->{RETURN CAST(CAST(CAST($date as Date)+DateTime::IntervalFromDays($delta_day) as Date) as String)};
$utc=CAST(CurrentUtcDate() as String);
select 
week,
target_new_goals_cost_share,
new_goals_cost_share
FROM `home/vipplanners/weekly_pack/new_goals`
WHERE $find_day($utc,-140)<week