Forum Discussion
Dateadd function not working
- 4 years ago
PREVIOUSYEAR returns the values covering all dates in the previous year, while DATEADD as you have it returns the values for the same date in the previous year.
Are there any values for the previous year's dates where it is now showing blank?Also, does the date table contain continuous dates covering the whole range of dates in the model?
Attach is the data model
PREVIOUSYEAR returns the values covering all dates in the previous year, while DATEADD as you have it returns the values for the same date in the previous year.
Are there any values for the previous year's dates where it is now showing blank?
Also, does the date table contain continuous dates covering the whole range of dates in the model?
- ysherriff4 years agoResolver II
Hi Paul,
To answer your last question first, the date table is continuous and covers the whole range of dates in the model, meaning the start and end date of the date table matches the start and end date of the model
As it relates to the first question, there are some date gaps within the model date. So it is not all continuous in the model. The data from the model is extracted from a user database so there is nothing I can do on that end.
Is there a workaround. All I am trying to do is get last year and last quarter using dateaddd in case i need to extract last 2 quarters or years. Dateadd is just more versatile.
I hope that helps.