Period over Period week of year

HelloPlease, from a custom filter, the user chooses a date interval I want to compare the number of this week to the number of the same week last year

Thanks

There are many posts already about period over period comparison. Check them out:

https://community.looker.com/lookml-5/period-over-period-date-comparisons-12802

https://community.looker.com/search?q=period%20over%20period

@Dawid please can i have a code lookml to Comparing a Previous Week to that Same Week Last Year from this example.

Thanks

dimension: period_comparison {

    case: {

      when: {

        sql: ${date} >= DATE_TRUNC('month', GETDATE())

          AND ${date} < DATE_TRUNC('day', GETDATE());;

        label: "current_month"

      }

      when: {

        sql: ${date} >= DATE_TRUNC('month', GETDATE() - interval '1 year')

          AND ${date} < DATE_TRUNC('day', GETDATE() - interval '1 year');;

        label: "last_year_same_month_same_point"

      }

      when: {

        sql: ${date} >= DATE_TRUNC('month',GETDATE()) - interval '1 month'

          AND ${date} < DATE_TRUNC('day', GETDATE() - interval '1 month');;

        label: "last_month_same_point"

      }

      else: "unknown"

    }

  }