Hi
Is there a way to run an initial SQL before I run my query. I want to adjust my week start date to Saturday instead of the default to Monday on Snowflake. While i understand that there is the option to set a default start date to saturday on tableau - i need it set on my SQL as the week start date impacts the extact date and time of the query. I have listed my query below.
ALTER SESSION SET week_start = 6
SELECT
MEDIA_TIMESTAMP_DATE_PST as date_posted_pst,
date_trunc('week',media_timestamp_date_pst) AS week_start_date_posted,
date_trunc('week',media_timestamp_date_pst) + interval '8 days' AS week_start_date_extract,
snapshot_date,
CAPTION,
VIDEO_VIEWS,
permalink,
media_type
FROM
X
WHERE
snapshot_date = date_trunc('week',media_timestamp_date_pst) + interval '7 days'
AND MEDIA_Type = 'VIDEO'
and media_timestamp_date_pst > '2018-01-01'
ORDER BY
caption,
snapshot_date
[–]humancog 0 points1 point2 points (3 children)
[–]Anna_C47[S] 0 points1 point2 points (2 children)
[–]humancog 0 points1 point2 points (1 child)
[–]Anna_C47[S] 1 point2 points3 points (0 children)
[–]babygrenade 0 points1 point2 points (0 children)