01-19-2016 01:54 PM
I have a dataset which is given as below.
And I want to create another dataset where I want to populate the value of Dose Freq for each patient at his last visit (mentioned as below, Please see the column X).
Can anyone tell me how to do it withing changing the sequence of the Visit and their date.
Many Thanks in Advance.
01-19-2016 02:51 PM
Here's one approach that should work:
by patient visit;
if first.patient then foo=dose_freq;
if last.patient then x=foo;
There are missing pieces, such as what variable names do you actually use? Is DOSE_FREQ actually populated only on the first observation for a patient?
01-19-2016 09:52 PM
01-20-2016 02:47 AM
it seems that you are mixing "real" data, with some calculations, perhaps for a report?
Not a best practice. It would be better if you have your business rule and the result of that in a separate table, with just patient id and dose_freq_last_visit.