BookmarkSubscribeRSS Feed
altijani
Quartz | Level 8

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

4 REPLIES 4
ballardw
Super User

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.

altijani
Quartz | Level 8

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.

Kurt_Bremser
Super User

@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.

altijani
Quartz | Level 8

The year is created.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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