Need Help with grouping range of days in a week

So I was ask get the weekly data score of each team we have, but in each week only  Sun - Thurs data shall be consolidated.

ex.

Week 31 = overall score from Sun - Thurs

Week 32 = overall score from Sun - Thurs

Week 33 = overall score from Sun - Thurs

and so fort…

0 2 985
2 REPLIES 2

You could achieve it in two ways:

  1. Easy - https://cloud.google.com/looker/docs/reference/param-model-week-start-day - but it changes your whole model to work in a different week
  2. Harder - you need to translate the Mon-Sun week to your desired week, especially if you want to use your field as a date and use the timeframes filters like ‘2 days ago’. If you use filter like this, your field has to do some more work in SQL to select the right data. Basically you still interact with data using “Last 2 weeks” but you need to change its meaning

Hi @Dawid I found an answer to it, but not sure if the best 1 out there or if I might face issues with it moving forward

I used Custom Filter

${date} = add_days(0, {week})

OR ${date} = add_days(1, {week})

OR ${date} = add_days(2, {week})

OR ${date} = add_days(3, {week})

While pivoting the “Week” it will only shows the data from Sun-Weds. it works fine at the moment, but would like to know if this workaround might cause me problem in the future.

Thank you

Top Labels in this Space