Sorting data files based on customized criteria

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Sorting data files based on customized criteria

Post by manishcspro »

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

Re: Sorting data files based on customized criteria

Post by Gregory Martin »

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.
manishcspro
Posts: 67
Joined: June 26th, 2017, 2:15 pm

Re: Sorting data files based on customized criteria

Post by manishcspro »

Thanks..
Post Reply