Question

Does anyone know how to code custom dimension to get "week_end_date" as a new dimension? Versus week_start_date.

  • 18 January 2022
  • 0 replies
  • 195 views

Hello Looker community,

 

I would like to find a way to create a new dimension grouping data for a datatype date to week_end_date versus week_start_team. A specific team I collaborate reports on week_end_date so I would like to utilize that.

 

I tried following these instructions listed in the looker help center… however it did not work. I kept getting an error when I went to query saying that it did not recognize DATEADD.

https://help.looker.com/hc/en-us/articles/360023906253-Week-Ending-Vs-Week-Beginning#:~:text=Week%20Beginning,-Daniel%20Nelson&text=Looker%20starts%20the%20week%20on,week%2004%2F08%2F2019.

 

Here is how I code the general date/timestamp.

 

dimension_group: purchase {
    type: time
    timeframes: [
      raw,
      date,
      week,
      month,
      quarter,
      year
    ]
    convert_tz: no
    datatype: date
    sql: ${TABLE}.purchase_date ;;


This topic has been closed for comments