BookmarkSubscribeRSS Feed
mmea
Quartz | Level 8

Hi I have a dataset like this

Test place Number of people Days of waiting time Group
A 121343 0 ONE
B 212 1 ONE
C 3434

1

TWO

D 45656 1 TWO

 

I need to sum up the number of people:

1. if JUST ONLY 1 test place has 0 days of waiting time, then all number of people in that group has 0 days of waiting time --> so in this case test place A has 0 days, therefor I need a new variable that has sum up number of people of A and B, as they are in same group.

2. If NO test places has 0 days of waiting time (as for C and D) then the new variable should sum up the number of people here.

 

make sense?

Bare in mind I have severel types of groups, and test places

output

 

test place Number of people Days of waiting time Group Sum0  
A 121343 0 ONE 121555  
B 212 1 ONE    
C 3434

1

TWO

  49090
D 45656 1 TWO    
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
  • 0 replies
  • 604 views
  • 0 likes
  • 1 in conversation