Closed chandryou closed 5 years ago
Owing to Anastasios Siapos' thorough review and help, I could recognize this issue and solve it.
This issue was solved by this thread https://github.com/chandryou/TicagrelorVsClopidogrel/commit/b8e5c174df6925661a83e0a4fdcb7481d0ce909f
Redshift does not like st. amount_value != '' because in our data, amount_value is numeric and redshift is fussy about comparing numeric to character ('') Changing to st.amount_value::char != '' fixed the problem.
Should be more careful with missing / zero days_supply and quantity, which is common in some DBs.
[inserting into #cov_6] https://github.com/chandryou/TicagrelorVsClopidogrel/blob/master/inst/sql/sql_server/CreateSubgroups.sql