Hi Team,
Request anyone to please kindly help with the below query.
I have a question where the data is as below:
TEST | RESULT | TIMEPOINT |
FU-ABC-1298 | 4.5 | 6 |
FU-ABC-1298 | 0 | 0 |
FU-ABC-1299 | 7.5 | 6 |
FU-ABC-1299 | 0 | 0 |
ABC-1298 | ||
ABC-1298 | ||
ABC-1298 | ||
ABC-1298 | ||
ABC-1299 | ||
ABC-1299 | ||
ABC-1299 | ||
ABC-1299 |
My output should look like below:
TEST | RESULT | TIMEPOINT |
FU-ABC-1298 | 4.5 | 6 |
FU-ABC-1298 | 0 | 0 |
FU-ABC-1299 | 7.5 | 6 |
FU-ABC-1299 | 0 | 0 |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 |
So you want to replace missing values with the last available non-zero non-missing value for a group?
Hi Team,
Request anyone to please kindly help with the below query.
I have a question where the data is as below:
TEST | RESULT | TIMEPOINT |
FU-ABC-1298 | 4.5 | 6 |
FU-ABC-1298 | 0 | 0 |
FU-ABC-1299 | 7.5 | 6 |
FU-ABC-1299 | 0 | 0 |
ABC-1298 | ||
ABC-1298 | ||
ABC-1298 | ||
ABC-1298 | ||
ABC-1299 | ||
ABC-1299 | ||
ABC-1299 | ||
ABC-1299 |
My output should look like below:
TEST | RESULT | TIMEPOINT |
FU-ABC-1298 | 4.5 | 6 |
FU-ABC-1298 | 0 | 0 |
FU-ABC-1299 | 7.5 | 6 |
FU-ABC-1299 | 0 | 0 |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1298 | 4.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 | |
ABC-1299 | 7.5 |
Just one question: what does the TIMEPOINT variable do, and why is it mostly missing?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.