We have a dataset containing two columns Date, Id and Value.
We are using the lag function to get the value from the previous financial year.
lag(Date, 364) over (partition by Id order by Date)
Wondering how we could use this to get the previous date the year before but matching on the date.
So 1st Feb 2018 compares to 1st Feb 2017. We can't just do 365 as the offset as that would be wrong for some years.
We have used the date dimension stuff to stack the data but for this use case we need the values on the same row.
- 10.6K All Categories
- 13 Getting Started in the Community
- 30 Beastmode & Analytics
- 2.1K Data Platform & Data Science
- 59 Domo Everywhere
- 2.7K Charting
- 2.4K Ideas Exchange
- 1.3K Connectors
- 362 Workbench
- 301 Use Cases & Best Practices
- 499 APIs
- 118 Apps
- 48 News
- 753 Onboarding
- 1.1K 日本支部
- 4 Private Company Board