Having sight of the real data here exposes a few issues:
The appropriate column to be partitioning on is the administrative column Der_Activity_Month rather than any of the patient activity dates. This simplifies things slightly as this column name is consistent across tables.
The appropriate cutoff date is the start of the financial year 2022-04.
Using this new column the NULL value problem is now so small as to be negligible.
Having sight of the real data here exposes a few issues:
The appropriate column to be partitioning on is the administrative column
Der_Activity_Month
rather than any of the patient activity dates. This simplifies things slightly as this column name is consistent across tables.The appropriate cutoff date is the start of the financial year 2022-04.
Using this new column the NULL value problem is now so small as to be negligible.
Closes #2048