Page 1 of 1

Calculate Fiscal Year

Posted: January 21st, 2020, 11:17 am
by btri Arjun
Dear CSPro team,

We are going to conduct an economic survey depending on fiscal year. In our country the fiscal year run like,

Fiscal year one = “2073/4/1 to 2074/3/30 “
Fiscal year two = “2074/4/1 to 2075/3/30 “
Fiscal year three = “2075/4/1 to 2076/3/30 “

The variables are; Year, month, day

Now, there is a variable “fiscal_year”. In this field the value label and code are as:
Fiscal year one = 1
Fiscal year two = 2 … so on.
Now, how can I fill up the given value automatically in the “fiscal_year” field depending on fiscal year?

Thank you.
Best.

Re: Calculate Fiscal Year

Posted: January 23rd, 2020, 9:43 am
by Gregory Martin
Can you explain this in more detail? Are you trying to get 1 from 2073 or 2073 from 1? If the former option, can you use the datediff function (assuming your calendar is Gregorian outside of the date), something like:
numeric fiscal_year = datediff(20720401, year * 10000 + month * 100 + day, "y");