Hi, I want to sort the data file in order to month starting from April to March.
My data has District code, Division code, Month code and Year in primary id,
since I assigned the month code 01 to 12 starting from Jan to Dec so it sorts the data in order to Jan to Dec
but my need is to sort the data from April (month code 04) to March (month code 03) in a financial year.
Please guide me..
Sorting data files based on customized criteria
-
- Posts: 67
- Joined: June 26th, 2017, 2:15 pm
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Sorting data files based on customized criteria
One option would be to add an item to your dictionary (on a singly-occurring record) that contains the month based on the financial year. You could use a batch application to set these values:
PROC MONTH
if MONTH >= 4 then
FINANCIAL_MONTH = MONTH - 3;
else
FINANCIAL_MONTH = MONTH + 9;
endif;
Then you could use the Sort Data tool to sort on FINANCIAL_MONTH.if MONTH >= 4 then
FINANCIAL_MONTH = MONTH - 3;
else
FINANCIAL_MONTH = MONTH + 9;
endif;
-
- Posts: 67
- Joined: June 26th, 2017, 2:15 pm