Union of two views count distinct patient ID
This is easily done using a custom query but I am trying to use tables for better performance (hopefully). First view has patientID and date and same with second view. when I put them together I get duplicate years and distinct count for each year.
I need a distinct count of the patientID for the whole year between both views for 2022.
The only way that I can think of that I have not tried is creating a third NULL view using that as the first view and join the two other views upon it. But They have to be aggregated as I have 200,000+ records for patientIDs and would like to run for 3 years prior to current year to current YTD.
Any ideas are welcome.