BookmarkSubscribeRSS Feed
JT99
Obsidian | Level 7
Hello!
My data looks like this:
Acct x1 x2 ...x24 date1 date2 ... date24
qaz 12 15 ...45 1jan19 1feb19 ... 1dec20
wsx 60 41 10aug18 10sep18

Basically, I have monthly payments x1, x2 up to x24 that a customer needs to pay on date1,date2 up to date24. Some accounts will have up to x12 and date12(12 months and not 24).
How do I get the sum of all payments(x1,x2,..,) where the corresponding date is less than a particular date for each account?
Any advice will be appreciated
2 REPLIES 2
Patrick
Opal | Level 21

Transpose your data into a narrow format with columns Acct Amount Date and everything else becomes simple.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 532 views
  • 2 likes
  • 3 in conversation