__STYLES__
The analysis of the Medan District Court is a project aimed at analyzing the data of the Case Tracking Information System of the Medan District Court, Indonesia. The goal of this project is to gain insights from the data of the Medan District Court on how they operate.
The questions I aimed to answer in this project are as follows:
To tackle these questions, I employed four tools: Excel, MySQL, and Power Bi . Here's a brief overview of how I made this project :
"Success Indicator" column: This column is used to categorize cases based on the following conditions:
- If the cases completed >= cases entered, then it falls into category 1.
- If the cases completed < cases entered, then it falls into category 2.
- If the cases entered = 0, then it falls into category 3.
- Category 1 means successfully resolving cases that were entered.
- Category 2 means there is a remainder of cases entered.
- Category 3 means there are no cases entered.
"Number of Completed Cases" column: This column is used to determine the number of cases that have been completed by subtracting the remaining cases from the remaining cases of the previous month.
how I used each tool for the project:
From 2017 to 2022, the graph below illustrates the top 3 cases with the highest number of entries.
Notes : The calculation excludes cases with zero entries.
The graph indicates a declining trend from 2020 to 2022, possibly attributed to the impact of the COVID-19 pandemic during those years, which restricted the mobility of the Medan community.
2017
2018
2019
2020
2021
2022
here's the sql code :
/*create table*/
create table cases (
month int,
year int,
number int,
classification varchar (100),
remaining_cases_flm int,
cases_entered int,
cases_completed int,
remaining_cases int);
select * from cases;
/*add column as succes indicator*/
SELECT month, year, classification, cases_entered, cases_completed,
CASE
WHEN cases_entered = 0 THEN 3
WHEN cases_completed >= cases_entered THEN 1
WHEN cases_completed < cases_entered THEN 2
END AS success_indicator
FROM cases;
alter table cases add column success_indicator int;
update cases
set success_indicator = (
CASE WHEN cases_entered = 0 THEN 3
WHEN cases_completed >= cases_entered THEN 1
WHEN cases_completed < cases_entered THEN 2
END
);
/*add column sum of done cases*/
alter table cases add column sum_of_cases_done int;
update cases
set sum_of_cases_done = (remaining_cases - remaining_cases_flm);
/*top cases that come in by year*/
select year, classification, sum(cases_entered) as sum_of_cases
from cases
where cases_entered <> 0 and cases_completed <> 0
group by year, classification
order by year asc;
/*average cases that come in by year*/
select year, CEILING (avg(cases_entered)) as average_cases
from cases
where success_indicator <> 3
group by year ;
/*cases that often incomplete */
select year, classification, count(classification) as count_of_incomplete_cases
from cases
where success_indicator = 2
group by year, classification
order by year asc, count_of_incomplete_cases desc ;
/* performance of medan court*/
select month, year, classification, remaining_cases - remaining_cases_flm as sum_of_cases_done
from cases
where success_indicator <> 3
group by year, classification
order by year asc, month asc ;
/*cases where the Medan district court often performs well*/
select month, year, classification, sum_of_cases_done
from cases
where success_indicator <> 3 and sum_of_cases_done <=0
group by year, classification
order by year asc, month asc ;
/*cases where the Medan district court often has poor performance*/
select month, year, classification, sum_of_cases_done
from cases
where success_indicator <> 3 and sum_of_cases_done >0
group by year, classification
order by year asc, month asc ;