Hi there, I’m having a challenge with the date converter. I have a pretty simple table that has a dimension group for dates. I selected date and filtered it to be within the last 90 days.
My DB stores dates in utc and the connection is set to convert them to PST. This is what the SQL generator gave us for the where clause -
WHERE ((((date ) >= ((CONVERT_TIMEZONE(‘US/Pacific’, ‘UTC’, DATEADD(day,-89, DATE_TRUNC(‘day’,CONVERT_TIMEZONE(‘UTC’, ‘US/Pacific’, GETDATE())) )))) AND (date ) < ((CONVERT_TIMEZONE(‘US/Pacific’, ‘UTC’, DATEADD(day,90, DATEADD(day,-89, DATE_TRUNC(‘day’,CONVERT_TIMEZONE(‘UTC’, ‘US/Pacific’, GETDATE())) ) )))))))
What’s up with that? It converts getdate into PST and then unconverts it - instead of converting it to PST and converting date to PST. There is no value set for convert_tz in the lookml for this. Thanks!