caciviclab / disclosure-backend-static

Campaign finance data powering Open Disclosure California
https://caciviclab.org/odca-jekyll/
15 stars 13 forks source link

Handle overlapping summary information #340

Closed mikeubell closed 5 months ago

mikeubell commented 9 months ago

If a committee files statements that have a time frame that covers a previous statement we include both in summary data. For the schedule data we delete duplicate transactions, so this is not an issue. We can add some SQL via a view to avoid this. e.g: Select distinct "Rpt_Date" from "Summary" s
where
not exists
(select t."Rpt_Date" from "Summary" t where s."Filer_ID" = t."Filer_ID"
and t."From_Date" <= s."From_Date" and s."Thru_Date" <= t."Thru_Date"
and (t."From_Date" <> s."From_Date" or s."Thru_Date" <> t."Thru_Date")
);