You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common pattern in dataset definitions is to determine an index date, which varies for each patient , and then use it to restrict the time period for other queries in the dataset e.g.
Because of the fiddliness involved in date arithmetic, and in calculating row-wise maxima, the SQL expression corresponding to is_on_or_between(index_date - years(1), index_date) can often be quite complex. And they are repeated over and over again for each query that uses them.
It would be good to spot this pattern, calculate the pair of dates once for each patient, write it to a temporary table and then just re-use it.
The text was updated successfully, but these errors were encountered:
A common pattern in dataset definitions is to determine an index date, which varies for each patient , and then use it to restrict the time period for other queries in the dataset e.g.
Because of the fiddliness involved in date arithmetic, and in calculating row-wise maxima, the SQL expression corresponding to
is_on_or_between(index_date - years(1), index_date)
can often be quite complex. And they are repeated over and over again for each query that uses them.It would be good to spot this pattern, calculate the pair of dates once for each patient, write it to a temporary table and then just re-use it.
The text was updated successfully, but these errors were encountered: