Hi Team,
I have BigQuery as a databases and Looker connecting to it. I am trying to create LookML Scripts for these time periods: MTD, QTD, YTD, Prev Mth, Prev Qtr, Prev Year . But having CAST or datatype conversions issues/errors.
I have followed links like, where its given for RedShift or MySQL, but unable to figure out for BigQuery. Any help will be used as a learning and appreciated.
https://help.looker.com/hc/en-us/articles/360023510474-Week-to-Date-WTD-Comparison
Can someone help for usage of right functions/keywords for BigQuery? Also I have the below Dimension_group table in my script:
dimension_group: rfrnc_dte {
type: time
timeframes: [
raw,
date,
week,
month,
quarter,
year,
day_of_week,
day_of_week_index,
day_of_month,
day_of_year,
week_of_year,
month_name,
month_num
]
convert_tz: no
datatype: date
sql: ${TABLE}.RFRNC_DTE ;;
}
Sometimes I had to add `CAST (${TABLE}.field AS TIMETAMP)` to Looker with BigQuery