{"version":"1.0","type":"rich","title":"Test study year and policy year mortality data long format","description":"This example shows how mortality data can be reshaped into long format for both study-year and policy-year analyses. A SQL script creates sample exposure-and-events records with policy IDs, dates, and covariates, then cross-joins them with dimension tables of study years (2009–2015) and policy years (1–7). Using `inner join` with year-based date filters, it generates observation rows for each active policy period, while a separate join uses `datediff('year', ...)` to assign policy-year exposures. The code relies on standard SQL `create table`, `insert`, and `select` statements to demonstrate the data preparation logic.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-d8b1b244f3c6f64abee1acffb956e919?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}