Calculate Fiscal Year

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
btri Arjun
Posts: 37
Joined: August 17th, 2018, 6:09 am

Calculate Fiscal Year

Post 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.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Calculate Fiscal Year

Post 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");
Post Reply