- 日期表 =
-
- VAR YearStart = 2023 //起始年度
- VAR YearEnd = 2024 //结束年度
-
- VAR WeekNumberType = 2
- VAR WeekDayType = 2
-
- RETURN
- GENERATE (
- CALENDAR( DATE( YearStart , 1 , 1 ) , DATE( YearEnd , 12 , 31 ) ),
- // CALENDAR( DATE( YearStart , 1 , 1 ) , TODAY() ),
- VAR Year = YEAR ( [Date] )
- VAR Month = MONTH ( [Date] )
- VAR Quarter = QUARTER( [Date] )
- VAR Day = DAY( [Date] )
- VAR Weekday = WEEKDAY( [Date] , WeekDayType )
- VAR Week_num = WEEKNUM([Date],WeekNumberType)
- VAR Week_start = FORMAT([Date]-Weekday+1,"YYYY-MM-DD")
- VAR Week_end = FORMAT([Date]-Weekday+7,"YYYY-MM-DD")
- RETURN ROW (
- "年" , Year ,
- "季" , Quarter ,
- "月" , Month ,
- "日" , Day ,
- "周",Weekday,
- "周数",Week_num,
- "星期",RIGHT(FORMAT([Date],"AAA"),1)
- )
- )