BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PetePatel
Quartz | Level 8

Hi,

 

I have a dataset in a similar format to below:

 

IDDateAmount
120-Oct-17-50
120-Oct-1760
121-Oct-17100
111-Nov-17250
201-Jul-1850
202-Jul-18-100
202-Jul-18100
202-Jul-18-50
205-Jul-18

200

 

 

I would like to sum by ID and date, and where negative default to 0 as follows:

 

IDDateNew_amount
120-Oct-170
120-Oct-1710
201-Jul-1850
202-Jul-180
205-Jul-18200

 

How can I easily create 'New_Amount' as I am grouping by 2 variables?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1

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
  • 1 reply
  • 2066 views
  • 0 likes
  • 2 in conversation