; met pivotdate zoals (selecteer dateadd (week, 17, „20100101“) als DayInWkNumX)
, keyDates (FirstDayNextWeek, FirstDay9WeeksAgo, FirstDayNextWeekOneYearAgo, FirstDay9WeeksAgoOneYearAgo)
zoals (
selecteer
DATEADD (week, datediff (week, 0, DayInWkNumX) +1.0),
DATEADD (week, datediff (week, 0, DayInWkNumX) - 9.0),
dateadd (yy, - 1, DATEADD (week, datediff (week, 0, DayInWkNumX) +1.0)),
dateadd (yy, - 1, DATEADD (week, datediff (week, 0, DayInWkNumX) - 9.0))
van pivotdate
)
selecteer Weeks10ToToday, Weeks10ToTodayOneYearAgo
van
(uitgezochte SOM (somevalue) ALS Weeks10ToToday van keyDates
binnen sluit me aan bij MyTable
op datefield >= FirstDay9WeeksAgo en datefield < FirstDayNextWeek="">= FirstDay9WeeksAgoOneYearAgo en datefield < FirstDayNextWeekOneYearAgo="">
|