Period over Period week of year

tatuspark
Participant IV
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

0 2 525
2 REPLIES 2

Dawid
Participant V

tatuspark
Participant IV

@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"


}


}
Top Labels in this Space
Top Solution Authors