Roll up adverse events by patient and date using sql group_concat with slc, r, python, and excel
Too long to post here,see github
https://github.com/rogerjdeangelis/utl-roll-up-adverse-events-by-patient-and-date-using-sqlite-groupcat-slc-r-python-and-excel
Two Solutions
Problem given a sqlite table with one adverse event per record
concatenate adverse events by patient and date
Two types of output sas dataset
ID AE_DATE AE_EVENTS
1 2022-06-23 nausea,manic
1 2022-08-05 cough,dizzy,vomit
...
COMMENTS
- Base SAS does not support the group_cancat sql function in base sas
- Also sas and the slc cannot close then re-open a excel workbook and add a sheet directly.
- You can reopen a closed workbook with proc R and proc Python and add a sheet.
- As a side note I believe you can add a sheet using powershell programatically (copysheet?)
see
https://github.com/rogerjdeangelis/utl-copy-excel-sheets-from-one-workbook-to-another-using-powershell