-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path创建当前财年计算表,包含过去两个财年.txt
More file actions
30 lines (30 loc) · 843 Bytes
/
Copy path创建当前财年计算表,包含过去两个财年.txt
File metadata and controls
30 lines (30 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
DIM ThisFYandPrevious =
VAR TodayDate = TODAY()
VAR CurrentYear = YEAR( TodayDate )
VAR CurrentMonth = MONTH( TodayDate )
VAR FiscalYearNum = CurrentYear + IF( CurrentMonth >= 10, 1, 0 )
VAR LastFiscalYearNum = FiscalYearNum - 1
VAR LastLastFiscalYearNum = FiscalYearNum - 2
VAR FiscalQuarter =
"Q" &
IF( QUARTER( TodayDate ) = 4,
1,
QUARTER( TodayDate ) + 1
)
VAR FiscalPeriod =
"P" &
IF( CurrentMonth >= 10,
CurrentMonth - 9,
CurrentMonth + 3
)
RETURN
SELECTCOLUMNS(
{ TodayDate },
"Today", TodayDate,
"Year", CurrentYear,
"FYNum", "FY" & FiscalYearNum,
"LastFYNum", "FY" & LastFiscalYearNum,
"LastLastFYNum", "FY" & LastLastFiscalYearNum,
"FiscalQuarter", FiscalQuarter,
"FiscalPeriod", FiscalPeriod
)