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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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