{"id":28213244,"url":"https://github.com/deddyandri/bank-loan-analysis","last_synced_at":"2026-01-25T16:02:22.219Z","repository":{"id":278390862,"uuid":"935459156","full_name":"deddyandri/Bank-Loan-Analysis","owner":"deddyandri","description":"Bank Loan Analysisi using SQL and Power BI","archived":false,"fork":false,"pushed_at":"2025-03-18T02:14:22.000Z","size":4558,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T12:43:57.688Z","etag":null,"topics":["dax","powerbi","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deddyandri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-19T13:34:16.000Z","updated_at":"2025-03-18T02:14:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"47b01965-68e2-4b4a-a57b-20ff0c1eb651","html_url":"https://github.com/deddyandri/Bank-Loan-Analysis","commit_stats":null,"previous_names":["deddyandri/bank-loan-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deddyandri/Bank-Loan-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deddyandri%2FBank-Loan-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deddyandri%2FBank-Loan-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deddyandri%2FBank-Loan-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deddyandri%2FBank-Loan-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deddyandri","download_url":"https://codeload.github.com/deddyandri/Bank-Loan-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deddyandri%2FBank-Loan-Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dax","powerbi","sql"],"created_at":"2025-05-17T20:10:19.044Z","updated_at":"2026-01-25T16:02:22.209Z","avatar_url":"https://github.com/deddyandri.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bank-Loan-Analysis\n\n[Visualization](https://app.powerbi.com/links/WE1RIBu1JQ?ctid=edcacd27-3770-4189-93ce-d963668dafdc\u0026pbi_source=linkShare)\n\n# Final Result\n\n![image](https://github.com/user-attachments/assets/ca5a8eb0-2693-48d5-9057-cfad0ff0e273)\n\n![image](https://github.com/user-attachments/assets/a0f23b12-9e68-4567-9dbc-23f686dbb576)\n\n![image](https://github.com/user-attachments/assets/92d81388-0788-4ebb-8be0-f78c1783b7f6)\n\n## Problem Statement\n\n### DASHBOARD 1: SUMMARY ###\n\nKey Performance Indicators (KPIs) Requirements:\n1. ***Total Loan Applications*** :\n   We need to calculate the total number of loan applications received during a specified period.\n   Additionally, it is essential to monitor the Month-to-Date (MTD) Loan Applications.\n3. ***Total Funded Amount*** :\n   Understanding the total amount of funds disbursed as loans is crucial.\n   We also want to keep an eye on the MTD Total Funded Amount and analyse the Month-over-Month (MoM) changes in this metric.\n5. ***Total Amount Received*** :\n   Tracking the total amount received from borrowers is essential for assessing the bank's cash flow and loan repayment.\n   We should analyse the Month-to-Date (MTD) Total Amount Received and observe the Month-over-Month (MoM) changes.\n7. ***Average Interest Rate***:\n   Calculating the average interest rate across all loans, MTD, and monitoring the Month-over-Month (MoM) variations\n   in interest rates will provide insights into our lending portfolio's overall cost.\n9. ***Average Debt-to-Income Ratio (DTI)*** :\n   Evaluating the average DTI for our borrowers helps us gauge their financial health.\n   We need to compute the average DTI for all loans, MTD, and track Month-over-Month (MoM) fluctuations.\n\n10. ***Good Loan v Bad Loan KPI’s***\n    **Good Loan:**\n    * Good Loan Application Percentage\n    * Good Loan Applications\n    * Good Loan Funded Amount\n    * Good Loan Total Received Amount\n\n    **Bad Loan :**\n    * Bad Loan Application Percentage\n    * Bad Loan Applications\n    * Bad Loan Funded Amount\n    * Bad Loan Total Received Amount\n\n### ***Loan Status Grid View***\nIn order to gain a comprehensive overview of our lending operations and monitor the performance of loans, \nwe aim to create a grid view report categorized by 'Loan Status.’ By providing insights into metrics \nsuch as **'Total Loan Applications,'** **'Total Funded Amount,'** **'Total Amount Received,'** \n**'Month-to-Date (MTD) Funded Amount,'** **'MTD Amount Received,'** **'Average Interest Rate,'** \nand **'Average Debt-to-Income Ratio (DTI),'** \nthis grid view will empower us to make data-driven decisions and assess the health of our loan portfolio.\n\n---\n\n### DASHBOARD 2: OVERVIEW ###\nCHARTS\n1. ***Monthly Trends by Issue Date (Line Chart)***:  To identify seasonality and long-term trends in lending activities\n2. ***Regional Analysis by State (Filled Map)***: To identify regions with significant lending activity and assess regional disparities\n3. ***Loan Term Analysis (Donut Chart)***: To allow the client to understand the distribution of loans across various term lengths.\n4. ***Employee Length Analysis (Bar Chart)***: How lending metrics are distributed among borrowers with different employment lengths,\n   helping us assess the impact of employment history on loan applications.\n6. ***Loan Purpose Breakdown (Bar Chart)***: Will provide a visual breakdown of loan metrics based on the stated purposes of loans,\n   aiding in the understanding of the primary reasons borrowers seek financing.\n8. ***Home Ownership Analysis (Tree Map)***: For a hierarchical view of how home ownership impacts loan applications and disbursements.\n\n### Metrics to be shown : \n**'Total Loan Applications,'** **'Total Funded Amount,'** and **'Total Amount Received'**\n\n---\n\n### DASHBOARD 3: DETAILS ###\n\nGRID\nNeed for a comprehensive 'Details Dashboard' that provides a consolidated view of all the essential information within our loan data. \nThis Details Dashboard aims to offer a holistic snapshot of key loan-related metrics and data points, enabling users to access critical \ninformation efficiently.\n\nObjective:\nThe primary objective of the Details Dashboard is to provide a comprehensive and user-friendly interface for accessing vital loan data. \nIt will serve as a one-stop solution for users seeking detailed insights into our loan portfolio, borrower profiles, and loan performance.\n\n---\n## Steps Process\n\nFirstly we have to check the file, data type whether the data type is appropriate \n\nespecially those related to dates and numbers\n\n### Create Database\n\n![image](https://github.com/user-attachments/assets/627d6144-34a8-46ea-899c-da637d9adeac)\n\nwe can name it with Bank Loan DB then click OK\n\n![image](https://github.com/user-attachments/assets/d5b3ed99-c1a9-44bf-9ecd-b30e55b58151)\n\nwe can see Bank Loan DB has been created\n\n![image](https://github.com/user-attachments/assets/6852e8e2-e4ba-48cc-8005-4ba7dc5c9501)\n\n### Import files\n\nright click on Bank Loan DB then task, and import flat file\n\n\u003cimage src=\"https://github.com/user-attachments/assets/ea7155c8-3c31-4ec0-8409-202081d26660\" width=50% heigh=50% /\u003e\n\nThere will be import flat file windows, in the specify input file section, \n\nbrowse the location of the csv file that we will import.\n\n\u003cimage src=\"https://github.com/user-attachments/assets/6e808ff6-f210-45b2-95d9-981f2bc3b120\" width=50% heigh=50% /\u003e\n\nthe file name is financial_loan.csv \n\n![image](https://github.com/user-attachments/assets/6ebf9bef-0520-4ad7-b41d-39c8485ad089)\n\nnew table name automatically names it financial_loan\n\n\u003cimage src=\"https://github.com/user-attachments/assets/90165032-ac10-4a18-b6d1-3e7bb701f02e\" width=60% heigh=60% /\u003e\n\nwe change it with bank_loan_data\n\n\u003cimage src=\"https://github.com/user-attachments/assets/7b8e0129-810e-4661-a99c-d8905ff103e6\" width=60% heigh=60% /\u003e\n\non the preview data, we can see a query that similar with csv data , then click next\n\n\u003cimage src=\"https://github.com/user-attachments/assets/8a27e671-4d03-4e6a-8758-e292ff25d6c2\" width=60% heigh=60% /\u003e\n\non the modify columns, we will add a primary key and change some data type\n\n\u003cimage src=\"https://github.com/user-attachments/assets/b6838619-fb72-4c46-986f-1f166957ef5f\" width=60% heigh=60% /\u003e\n\nwe make the id column the primary key, and nvarchar is changed to varchar, then click next and finish\n\n![image](https://github.com/user-attachments/assets/67a7f3e3-9dfd-4f7a-b814-d5c97263cd0e)\n\n### Error Message\n\n\u003cimage src=\"https://github.com/user-attachments/assets/17973bc1-923d-49fc-9c98-0fbd7b14e7db\" width=60% heigh=60% /\u003e\n\nclick on the error sign \n\nthe message says \n\n![image](https://github.com/user-attachments/assets/5ff5d168-d96d-42e3-9611-aed10e8bf84e)\n\nthen we go back to modify column , then find total_payment and loan_amount\n\n![image](https://github.com/user-attachments/assets/66c0893a-aad1-4866-9e41-a90b0afab302)\n\nwe change data type from smallint into int, then click next\n\n![image](https://github.com/user-attachments/assets/31fc2397-6387-4fd1-908a-22e79fde2717)\n\nthere is still an error says \n\n![image](https://github.com/user-attachments/assets/307452bb-fe51-4ac0-89f5-c16082cbe0a6)\n\nwe will check by open CSV file, to find what column that consist of more than 50 character\nwe see that column emp_title shows over 50 characters\n\n\u003cimage src=\"https://github.com/user-attachments/assets/6c2a7920-80a7-4931-a62c-0886ba1cb774\" width=60% heigh=60% /\u003e\n\nchnge Data type of Column name \"emp_title\" into varchar(100) type manually or varchar(MAX)\n\n![image](https://github.com/user-attachments/assets/4cf86c5b-1970-4528-89f7-95c6f399ad25)\n\ndont forget to uncheck the bottom of preview data\n\n![image](https://github.com/user-attachments/assets/1b4e7219-e8d0-4291-ba92-a1e631c21cf8)\n\nthen we can click next until finish and close\n\nwe start with blank query, then click on New Query\n\n![image](https://github.com/user-attachments/assets/ba20cbda-2bf8-408a-b9d3-46fb8d2264bb)\n\ntype \n\n```sql\nSELECT * FROM bank_loan_data\n```\nwe got\n\n![image](https://github.com/user-attachments/assets/e6d9b42f-8a7a-43da-a459-e091be5ae537)\n\n---\n## Bank Requirement : \n1 Total Loan Applications\n\n```sql\n-- 1. Total Loan Application\nSELECT \n\tCOUNT(id)  Total_Loan_application\nFROM bank_loan_data \n```\nthe outcome are\n\n![image](https://github.com/user-attachments/assets/57f6f012-ccc2-459b-a08c-09aded373b50)\n\n1a. Month-to-Date (MTD) Loan Applications\n\n```sql\n-- 1a. MTD Loan Application\n\nSELECT COUNT(id) as MTD_Total_Application FROM Financial_loan\nWHERE MONTH(issue_date) = 12\n```\nwe got\n\n![image](https://github.com/user-attachments/assets/2306a79b-0158-492c-bd06-06633c896502)\n\n2. Total Funded Amount\n   \n```sql\n-- 2. Total Funded Amount\n\nSELECT \n\tSUM(loan_amount) as Total_loan_amount\n\tfrom Financial_loan\n```\nresult\n\n![image](https://github.com/user-attachments/assets/a38f8e17-7611-4bd2-9a65-37bcdb71a7b9)\n\n3. Total Amount Received\n\n```sql\n-- 3. Total Amount Received\nSELECT\n\tSUM(total_payment) as Total_loan_received\nFROM\n\tFinancial_loan\n```\nresult\n\n![image](https://github.com/user-attachments/assets/c0226b8b-cea7-4824-b75b-697f3409222d)\n\nnow we want to know the average interset rate\n\nwe use coulumn\n\n![image](https://github.com/user-attachments/assets/6c6d80ca-6215-48f6-8613-1174eed0998a)\n\n4.  Average Interest Rate\n```sql\n-- 4. Average Interest Rate\nSELECT\n\tROUND(AVG(int_rate), 4) as Average_int_rate\nFROM\n\tFinancial_loan\n```\nthe result is\n\n![image](https://github.com/user-attachments/assets/52b62cb4-4a76-457c-92d3-4723d4aec678)\n\nwe need it in percentage form\n\n```sql\nSELECT\n\tROUND(AVG(int_rate), 4) * 100 as Average_int_rate\nFROM\n\tFinancial_loan\n```\n\nend result is\n\n![image](https://github.com/user-attachments/assets/a8300e27-0c7e-474f-bce9-59b35ef0e107)\n\n\n5. Average Debt to Income Ratio\nA debt-to-income (DTI) ratio is a percentage that measures how much of your monthly income goes toward debt.\nIt's calculated by dividing your total monthly debt by your gross monthly income\n\nPurpose: DTI measures the borrower's debt burden relative to income. It gauges the borrower's capacity to take on additional debt.\nUse for Banks: Banks use DTI to assess a borrower's ability to handle loan payments and make responsible lending decisions.\n\nfrom the financial loan table, the debt to income ratio column is already available, \nso we don't need to divide montly debt by gross montly income.\nthe column name is dti\n\n![image](https://github.com/user-attachments/assets/debcad40-9ae8-4b29-93a6-84440629a693)\n\n```sql\n-- 5. Average Debt to Income Ratio\nSELECT \n\tAVG(dti)*100 as Average_DTI\nFROM Financial_loan\n```\n\nthe result :\n\n![image](https://github.com/user-attachments/assets/449f76aa-0cdb-4f22-a0fd-ab28ac05a11d)\n\n---\n# Good Loan Issued\n\n1. Good Loan Percentage\n\nfirst, we will review the financial loan table, \n\nthere is a column called loan_status that will give the results of \n\nthe Good loan and Bad loan values for the Good vs Bad Loan column.\n\n![image](https://github.com/user-attachments/assets/a051d694-c5ba-4145-a0eb-176ee063c39f)\n\nGood loan categories are those with Fully paid and Current status.\n\nwhile the Bad Loan category is Charged Off.\n\n![image](https://github.com/user-attachments/assets/f88785d5-2783-41fb-bc3c-64ff5c3c3c21)\n\nwe first find how many are loan_status with fully paid and current \n\n```sql\nSELECT\n\tCOUNT(id) from Financial_loan\n\tWHERE loan_status ='Fully Paid' OR loan_status = 'Current'\n```\nthe result is 33.243\n\n![image](https://github.com/user-attachments/assets/73bb0703-4d8e-458b-aed2-dc0e01bacd71)\n\nthen find total number of loan\n```sql\nCOUNT(id) from Financial_loan\n```\nwe got 38.576 \n\n![image](https://github.com/user-attachments/assets/05a14bf7-6209-4688-84db-5fbf0f6b487f)\n\nnow we can divide all using subquery method, and name it as Good Loan Percentage\n\n```sql\nSELECT\n\t(SELECT\n\tCOUNT(id) from Financial_loan\n\tWHERE loan_status ='Fully Paid' OR loan_status = 'Current')*100.\n\t/\n\t(SELECT\n\tCOUNT(id) from Financial_loan)\nas Good_Loan_Percentage\n```\nthe final result is 86.17 %\n\n2. Good Loan Application\n\nas we have made before\n\n```sql\nSELECT\nCOUNT(id) as Good_Loan_Applications\nFROM\nFinancial_loan\nWHERE loan_status = 'Fully Paid' OR loan_status = 'Current'\n```\nwe get the same result as above\n\n![image](https://github.com/user-attachments/assets/e230d0dd-1eb9-44b0-b5ef-2010d8b2f18b)\n\n\n3. Good Loan Funded Amount\n\nLoan funded means, loans provided by banks to customers\n\nfrom the given file there are loan_amount and total_payment columns\n\n![image](https://github.com/user-attachments/assets/b91dd28a-5ec1-470d-b4be-86981080c5c4)\n\nA loan amount is the total amount of money customers borrow, \n\nwhile total payments is the total amount of money customers will pay back over the life of the loan\n\nwe will use loan_amount column just for Good Loan Status\n\n```sql\n-- 3. Good Loan Funded Amount\nSELECT\n\tSUM(loan_amount) as Good_Loan_Funded_amount\n\tFROM\nFinancial_loan\n\tWHERE loan_status = 'Fully Paid' OR loan_status = 'Current'\n```\nthe result is $ 370.224.850\n\n![image](https://github.com/user-attachments/assets/4864df1a-3509-4e63-94e6-6b3da87095b9)\n\n4. Good Loan Amount Received\n```sql\n-- 4. Good Loan Amount Received\nSELECT\n\tSUM(total_payment) as Good_Loan_amount_received\nFROM\n\tFinancial_loan\nWHERE \n\tloan_status= 'Fully Paid' OR loan_status = 'Current'\n```\nthe result is $ 435.786.170\n\n![image](https://github.com/user-attachments/assets/102020f4-306b-4abd-b211-63a2b1ee8fdd)\n\n\n# Bad Loan Issued\n\nsimilar with above query, just change loan_status into \"Charge Off\"\n\n1. Bad Loan Percentage\n   \n```sql\n\n-- 1. Bad Loan Percentage\nSELECT\n\t(SELECT\n\tCOUNT(id) from Financial_loan\n\tWHERE loan_status ='Charged Off')*100.\n\t/\n\t(SELECT\n\tCOUNT(id) from Financial_loan)\nas Bad_Loan_Percentage\n```\n\nthe result is 13,8 %\n\n![image](https://github.com/user-attachments/assets/b2f03d50-17c3-47db-b33c-5cd173eec369)\n\n2. Bad Loan Application\n\n```sql\n-- 2. Bad Loan Applications\nSELECT\n\tCOUNT(id) as Bad_Loan_Applications\nFROM\n\tFinancial_loan\nWHERE\n\tloan_status ='Charged Off'\n```\n\nresults is 5.333 bad loan application\n\n![image](https://github.com/user-attachments/assets/0418b92c-75f7-4450-a6de-add5931acf75)\n\n3. Bad Loan Funded Amount\n\n```sql\n-- 3. Bad Loan Funded Amount\nSELECT\n\tSUM(loan_amount) as Bad_loan_funded_amount\nFROM\n\tFinancial_loan\nWHERE\n\tloan_status ='Charged Off'\n```\n\nthe result is $ 65.532.225\n\n![image](https://github.com/user-attachments/assets/8af9ee5a-eb1c-42a4-a0aa-75be19d31421)\n\n4. Bad Loan Amount Received\n\n```sql\n-- 4. Bad Loan Amount Received\nSELECT\n\tSUM(total_payment) as Bad_Loan_amount_received\nFROM\n\tFinancial_loan\nWHERE\n\tloan_status = 'Charged Off'\n```\n\nthe result is $ 37.284.763\n\n![image](https://github.com/user-attachments/assets/0d7aad40-e991-43d9-8ef4-b7cc78fbf3f8)\n\n---\n## Loan Status\n\n```sql\n-- LOAN STATUS\nSELECT\n\tloan_status,\n\tCOUNT(id) as LoanCount,\n\tSUM(total_payment) as Total_Maount_Received,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tAVG(int_rate * 100) as Interest_Rate,\n\tAVG(dti*100) as DTI\nFROM\n\tFinancial_loan\nGROUP BY\n\tloan_status\n```\n\nthe result, we will use it as Visualization on PowerBI Desktop\n\n![image](https://github.com/user-attachments/assets/1ecafd09-8ef4-445e-9bca-bf67b788011d)\n\n---\n## Bank Loan Report\n\n### MONTH \nto find Total Funded Amount and Total Amount Received for every month\n\nwe will use column\n\nid, issue_date , loan_amount and total_payment \n\n```sql\n-- B. BANK LOAN REPORT \n\n-- MONTH\n\nSELECT\n\tMONTH(issue_date) as Month_Number,\n\tDATENAME(MONTH,issue_date) as Month_name,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\n\nFROM Financial_loan\nGROUP BY MONTH(issue_date), DATENAME(MONTH, issue_date)\n\nORDER BY MONTH(issue_date)\n```\n\nthe result are\n\n![image](https://github.com/user-attachments/assets/6df0b1fc-a5a8-468c-926d-4ca5b9cb34cf)\n\n### STATE\n\nwe will look for any State related to this bank loan\n\nwe will use id, addres_state, loan_amount and total_payment column\n\n```sql\n-- STATE\n\nSELECT\naddress_state as State,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY address_state\nORDER BY address_state\n```\n\nwe got\n\n![image](https://github.com/user-attachments/assets/7fd775cf-c600-4917-8675-571e98dde999)\n\nwe would list from the biggest loan amount received to the lowest\n\n```sql\n-- order from biggest to lower\n\nSELECT\naddress_state as State,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY address_state\nORDER BY Total_Amount_Received DESC\n```\nthe result are CA (California), NY(New York) and TX(Texas) are the biggest Loan State , and also the biggest Total loan Application\n\n![image](https://github.com/user-attachments/assets/b4b64582-e865-4453-b6d8-a993d2e90762)\n\n### Term\n\nTerm defines the duration of the loan in months. It sets the repayment period.\nBanks use the term to structure loan agreements, calculate interest payments, and manage loan maturities.\n\nwe will know how much term this loan is given\n\n```sql\n--TERM\nSELECT\nterm as Term,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY term\nORDER BY Term\n```\n\nthe resuls :\n\n![image](https://github.com/user-attachments/assets/eee7e807-6d2d-439b-859e-10eaf207c9f4)\n\n### Employee Length\n\nnext, we will find employee length\n***Purpose***: Employee Length provides insights into the borrower's employment stability. \n\nLonger employment durations may indicate greater job security.\n\n***Use for Banks***: Banks consider employment length when assessing a borrower's ability to repay. \n\nStable employment often translates to a lower default risk.\n\nwe use emp_length column\n\n```sql\n--Employee Length\nSELECT\n\temp_length as Employee_Length,\n\tCOUNT(id) as Total_Loan_Applications,\n\t\tSUM(loan_amount) as Total_Funded_Amount,\n\t\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY emp_length\nORDER BY emp_length\n```\n\nthe result are\n\n![image](https://github.com/user-attachments/assets/573a05a0-e111-40a1-8d69-28163341039b)\n\n### Purpose\n\n```sql\n---Purpose\nSELECT\n\tPurpose as Purpose,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY Purpose\nORDER BY Purpose\n```\nwe got\n\n![image](https://github.com/user-attachments/assets/f58279ba-1530-4486-b774-3d2e962f777e)\n\nthen we will find the top purpose based on Total Funded amount\n\n```sql\n--- Top Purpose\nSELECT\n\tPurpose as Purpose,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY Purpose\nORDER BY Total_Funded_Amount DESC\n```\nWe know that debt consolidation, credit cards, and home improvement \n\nare the biggest purpose of borrowers.\n\n![image](https://github.com/user-attachments/assets/9543868d-2ae2-43ae-8a61-cccc5d83b0ad)\n\n### Home Ownership\n\nin the csv file, there is a column named home_ownership\n\n![image](https://github.com/user-attachments/assets/ca9527c8-088c-4bfe-b24d-3db6b0d65045)\n\nHome Ownership indicates the borrower's housing status. It offers insights into financial stability.\n\nBanks use this field to assess collateral availability and borrower stability. Homeowners may have lower default rates\n\n--Home Ownership\n```sql\nSELECT\n\thome_ownership as Home_Ownership,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY home_ownership\nORDER BY home_ownership\n```\n\nthe result are \n\n![image](https://github.com/user-attachments/assets/035303c9-360b-4955-b6ff-2576a70204c0)\n\nif we create a list based on Total_Amount_Funds from the highest\n\n```sql\nSELECT\n\thome_ownership as Home_Ownership,\n\tCOUNT(id) as Total_Loan_Applications,\n\tSUM(loan_amount) as Total_Funded_Amount,\n\tSUM(total_payment) as Total_Amount_Received\nFROM Financial_loan\nGROUP BY home_ownership\nORDER BY Total_Funded_Amount DESC\n```\n\nAs a result, bank customer who have a homeowner MORTGAGE have the highest total funded amount \n\n![image](https://github.com/user-attachments/assets/8829b2b3-cbb1-4029-8f72-6e05f5115d81)\n\nNOW we move to Power BI Desktop to make Visualiztion\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeddyandri%2Fbank-loan-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeddyandri%2Fbank-loan-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeddyandri%2Fbank-loan-analysis/lists"}