mercredi 3 juin 2015

Require mapping logic for a scenario

I have a set of past 12 month income record for a person like 01-JAN - Rs 10,000 02-FEB - Rs 10,000 03-MAR - Rs 10,000 04-APR - Rs 10,000 05-JUN - Rs 18,000 06-JUL - Rs 10,000 07-AUG - Rs 10,000 .... 12-DEC - Rs 15,000

eg: If I request for customer past 12 month salary, it will get the current month and give last 12 month salary, it doesnot have year detail. if its June 2015, the record from Jan - June 2015, and record from July to Dec 2014.

I require a common logic to map data like currentmonthsalary = june salary, previous1monthsalary = may salary.. like the same for past 12 months... previous12thmonthsalary = July salary.

The above mapping of data will change depends on the current month.

I require some common logic to do this mapping.

Any help is appreciated.

Aucun commentaire:

Enregistrer un commentaire