Contributor
Posts: 46

Calculate Payments between two dates

[ Edited ]

Hi,

I have the following dataset. Please note that Paymment is Commulative to the previouse payment. I need to compute the ANNUAL and Monthly payments for the entire dataset. I am using Enterprise Guide, but can use a code to save in a program:

Name        Month      Total Payment

Al              Dec           10                     (the data is backdated to the previous year to facilitate the calculations)

Al              Jan            50                     (which means that the payment for this month is 40 only, and so on)

Al              March        75

Al              June         110

Tara          Dec             0

Tara          Jan             20

Tara          Feb            35

Tara          Dec           100

For the above example, I need to create 2 new columns that shows the payments were as follows:

Annual:

Al = 100

Tara = 100

Monthly:

it shows the monthly increment from the previous month.

Thank you for looking into this.

Altijani

Super User
Posts: 13,583

Re: Calculate Savings between two dates

If you don't have a YEAR variable you're causing yourself all kinds of extra work.

And show exactly what you want the output to look like.

Contributor
Posts: 46

Re: Calculate Savings between two dates

Thanks Ballardw

I can create a year variable, but currently I dont have.

The output should look like this:

Name        Total Yearly Payment

Al              100

Tara          100

Hope this clarifies.

Super User
Posts: 10,280

Re: Calculate Savings between two dates

altijani wrote:

Thanks Ballardw

I can create a year variable, but currently I dont have.

Then you should create one ASAP. Without a year variable, or real dates, you're just setting up yourself for a rude awakening.

Intelligent data drives intelligent programs (Maxim 33). What you have now is, err, not intelligent.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 46

Re: Calculate Savings between two dates

The year is created.

Discussion stats
• 4 replies
• 170 views
• 0 likes
• 3 in conversation