Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions data/fr/02_fr_tbl_10_creation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
" select\n",
" fr_timeliness_info_minus.sourcecasereferencecid as case_number,\n",
" fr_timeliness_info_minus.year,\n",
" fr_timeliness_info_minus.year_quarter,\n",
" replace(fr_timeliness_info_minus.year_quarter, '-', '|') as year_quarter,\n",
" case when fr_timeliness_info_minus.petitioner_represented = 'Yes'\n",
" and fr_timeliness_info_minus.respondent_represented = 'No'\n",
" then 1 else 0\n",
Expand Down Expand Up @@ -518,7 +518,15 @@
" representation\n",
")\n",
"\n",
"select * from fr_timeliness_rep_region\n",
"select\n",
" case_type,\n",
" region,\n",
" representation,\n",
" replace(year_quarter, '|', '-') as year_quarter,\n",
" number_of_disposals,\n",
" mean_duration,\n",
" median_duration\n",
"from fr_timeliness_rep_region\n",
"order by\n",
"region,\n",
"representation,\n",
Expand All @@ -535,8 +543,8 @@
"metadata": {},
"outputs": [],
"source": [
"test = pydb.read_sql_query(\"SELECT * from __temp__.fr_timeliness_rep_region\")\n",
"test"
"#test = pydb.read_sql_query(\"SELECT * from __temp__.fr_timeliness_rep_region\")\n",
"#test"
]
},
{
Expand Down Expand Up @@ -584,7 +592,15 @@
" \n",
")\n",
"\n",
"select * from fr_timeliness_rep_ew\n",
"select\n",
" case_type,\n",
" region,\n",
" representation,\n",
" replace(year_quarter, '|', '-') as year_quarter,\n",
" number_of_disposals,\n",
" mean_duration,\n",
" median_duration\n",
"from fr_timeliness_rep_ew\n",
"order by\n",
"representation,\n",
"year_quarter\n",
Expand All @@ -600,8 +616,8 @@
"metadata": {},
"outputs": [],
"source": [
"test = pydb.read_sql_query(\"SELECT * from __temp__.fr_timeliness_rep_ew\")\n",
"test"
"#test = pydb.read_sql_query(\"SELECT * from __temp__.fr_timeliness_rep_ew\")\n",
"#test"
]
},
{
Expand All @@ -628,7 +644,7 @@
" round(avg(app_to_first_fr_weeks), 3) as All_mean\n",
" from __temp__.fr_timeliness_with_rep\n",
" where \n",
" year between 2011 and {current_year}\n",
" year between 2011 and {annual_year}\n",
" group by \n",
" year\n",
" order by \n",
Expand Down Expand Up @@ -658,7 +674,7 @@
"source": [
"create_fr_table_10_lookup_qtr_table = f\"\"\"\n",
" select \n",
" 'Financial Remedy|'|| year_quarter || '|' AS lookup,\n",
" 'Financial Remedy|'|| year_quarter AS lookup,\n",
" sum (both_rep) as Both_n,\n",
" round (avg(case when both_rep=1 then app_to_first_fr_weeks end), 3) as Both_mean, \n",
" sum (pet_rep) as Applicant_n,\n",
Expand Down Expand Up @@ -690,8 +706,8 @@
"metadata": {},
"outputs": [],
"source": [
"test = pydb.read_sql_query(\"SELECT * from __temp__.fr_table_10_lookup_qtr\")\n",
"test"
"#test = pydb.read_sql_query(\"SELECT * from __temp__.fr_table_10_lookup_qtr\")\n",
"#test"
]
},
{
Expand Down Expand Up @@ -797,7 +813,7 @@
"source": [
"drop_fr_rep_timeliness = \"DROP TABLE IF EXISTS fcsq.fr_rep_timeliness\"\n",
"pydb.start_query_execution_and_wait(drop_fr_rep_timeliness)\n",
"bucket.objects.filter(Prefix=\"fcsq_processing/FR/drop_fr_rep_timeliness\").delete();"
"bucket.objects.filter(Prefix=\"fcsq_processing/FR/fr_rep_timeliness\").delete();"
]
},
{
Expand Down Expand Up @@ -859,9 +875,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "new_kernel",
"display_name": "fcsq_data_min",
"language": "python",
"name": "venv_new_kernel"
"name": "venv_fcsq_data_min"
},
"language_info": {
"codemirror_mode": {
Expand Down