<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chinenye Agba on Medium]]></title>
        <description><![CDATA[Stories by Chinenye Agba on Medium]]></description>
        <link>https://medium.com/@chinenyeagba?source=rss-e05c595e642b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9XRrT00CvgYrVo0yiYwqVw.png</url>
            <title>Stories by Chinenye Agba on Medium</title>
            <link>https://medium.com/@chinenyeagba?source=rss-e05c595e642b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:05:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chinenyeagba/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CUSTOMER CHURN ANALYSIS — Power BI Project]]></title>
            <link>https://medium.com/@chinenyeagba/customer-churn-analysis-power-bi-project-ade7bc95778?source=rss-e05c595e642b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ade7bc95778</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[customer-churn]]></category>
            <category><![CDATA[power-query]]></category>
            <category><![CDATA[power-bi-reports]]></category>
            <dc:creator><![CDATA[Chinenye Agba]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 16:42:51 GMT</pubDate>
            <atom:updated>2023-06-03T12:50:55.158Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>CUSTOMER CHURN ANALYSIS — Power BI Project</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*RAeucVCKyFGXArObBsYnrw.png" /><figcaption>Customer Churn: Image from Kaggle</figcaption></figure><p><strong>Overview</strong></p><p>What is Customer churn? This is essentially the rate at which customers leave a business against the total customers that are actively in business. This is also known as <em>churn rate </em>or <em>customer attrition</em>.</p><p><strong>Project Objective:</strong></p><p>The objective of this analysis is to discover various factors contributing to increased customer churn rate at the bank, and provide the business users with these insights which they can use to make informed decisions and strategize on how to improve customer retention and reduce churn rate.</p><p><strong>Tools: </strong>I used Power BI and Power Query for this analysis.</p><p><strong>About the data</strong></p><p>The raw data was provided in the form of a <a href="https://github.com/technwa/PortfolioProjects/blob/main/customer_churn_data.csv"><em>CSV file</em></a> with 10,000 rows of data. Data was sourced from a commercial bank who was looking to improve its customer churn rate.</p><p><strong><em>Note</em></strong>: all personally Identifiable information has been removed from this data to protect customer’s private and sensitive information.</p><p><strong>Data Dictionary</strong></p><ul><li><strong>customer_id</strong>: This is the customers’ unique id which identifies them bankwide.</li><li><strong>credit_score:</strong> this is the rating of the customers’ credit worthiness, generated based on the information on their credit report.</li><li><strong>country</strong>: This is the country the customer hails from.</li><li><strong>gender</strong>: This is the sex of the customer, grouped into male and female.</li><li><strong>age</strong>: This refers to the customer’s age.</li><li><strong>tenure</strong>: The number of years of relationship this customer has maintained with the bank.</li><li><strong>balance:</strong> The deductible balance on their bank account as at time this data was generated.</li><li><strong>products_number:</strong> This shows the bank account type the customer has.</li><li><strong>credit_card:</strong> This column shows if a customer has a credit card or not, represented as either 1 or 0 respectively.</li><li><strong>active_member:</strong> These numerical values show whether an account is active or not, represented as either 1 or 0 respectively.</li><li><strong>estimated_ salary</strong>: This is the average annual salary received into the account.</li><li><strong>churn:</strong> This field shows if the customer is still with the bank or not, represented by either 0 or 1 respectively.</li></ul><p><strong>Data Discovery</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lVKXCag_HXSEqrP4oJC1Q.png" /><figcaption>Raw data</figcaption></figure><p>I opened the data in excel and inspected the columns for relevance to the business task (This can equally be done directly on Power Query), I was able to confirm that there is sufficient data to aid my analysis. However, data needed to be cleaned and properly transformed in the format that would be useful for the analysis.</p><p><strong>Limitations</strong>: The data provided by the business user is only that of salary-earning customers.</p><p><strong>Analytical Steps</strong></p><ol><li>Data Preparation</li><li>Data Categorization and Grouping</li><li>Formatting</li><li>Data Transformation</li><li>Data Modeling</li><li>Visualisation — Report</li><li>Insights</li><li>Recommendation</li><li>Conclusion</li></ol><p><strong>Note</strong>: Step 2- 4 are iterative as I had to repeat them as needed throughout this activity.</p><ol><li><strong>Data Preparation</strong></li></ol><p>I imported the data into Power BI and transformed it on Power Query as follows:</p><ul><li>I renamed the data from <em>customer_churn_data</em> to <em>Customer Data </em>for clarity. The new name better captures what the content of this file is. .</li><li>Next, I eliminated the auto-generated header, by promoting the first row of my data to become the header. The option for this can be found on both the home tab and the transform tab of Power Query Editor.</li><li>With the project objective in mind, I sought to eliminate any data that would be irrelevant to my analysis. I removed the <em>estimated_salary</em> column, since they are estimates anyways and there is another column with account balance information for each customer and that would be more useful for analysis. To remove the column, I right-clicked on the column header and clicked on<em> remove colum</em>.</li></ul><p><strong>Note</strong>: Power Query provides an <em>applied steps</em> pane, where any change made on the editor is automatically recorded. To customise this feature which greatly aided my documentation, I renamed each step to better describe the action I took. To rename, simply right-click any of the steps and select <em>rename.</em></p><p><strong>2. Data categorization and Grouping.</strong></p><ul><li>In order to clearly label the data in the <em>products_number</em> column, I utilized the <em>replace values</em> option. Since it indicates the account type a customer owns, I replaced product 1,2,3, and 4, with Prod 1, Prod 2, Prod 3, and Prod 4 respectively. I followed it up with deleting the original column.</li><li>For the <em>age</em>, <em>credit_score, balance </em>columns, I looked at the column profile from the <em>View </em>tab, and saw that there was a wide range between the minimum and maximum values.</li><li>The <em>Age</em> column had 60 distinct value with a minimum of 18 and a maximum of 82</li><li>The <em>credit_score </em>column had 354 distinct values with a minimum of 376 and a maximum of 850.</li><li>The <strong>balance </strong>column had 649 distinct values. With a minimum of 0 and a maximum of 213146.2</li></ul><p>I then grouped each of them using <em>conditional column</em> function.</p><p><strong>3. Formatting</strong></p><p>The following columns; <em>churn</em>, <em>active_member</em> and <em>credit_card</em> had boolean datatypes of 1 and 0, essentially representing true or false. However, this lacks clarity and would be confusing on the report. I formatted them by using the <em>replace values</em> option to change them to more intuitive data types.</p><ul><li>For active_member column, 0 = dormant, 1 = active</li><li>For churn column, 0 = not churned, 1 = churned</li><li>For credit_card column, 0 = no, 1 = yes</li></ul><p><strong>4. Data Transformation</strong></p><p>Here, I created Queries to organise data for better analysis and reporting.</p><p>Because I had grouped some of these columns used symbols like &lt;, &gt;=, etc, and changed the groups to them to text data type, I was not able to filter it successfully in ascending or descending order. This is because the system would place all the groups with numbers only first, before the ones with symbols as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*STNj4eHP_zUA0f6w-sVp6w.png" /><figcaption>Before custom Sorting</figcaption></figure><p>In order to get them in chronological order, I created a reference table from the original one. In this new table, I equally created an index column using the <em>Conditional column </em>option to represent each unique entry in order, and allow me to filter them chronologically.</p><ul><li>To achieve this, I started by selecting the column of interest. On the queries pane, I right-clicked on the data and selected the <em>reference</em> option which created a new table. I removed all other columns except the one I wanted to index, then renamed this new table to reflect the column accordingly.</li><li>Next, I removed duplicate rows leaving behind only the distinct values that I would index. Since it was a custom sorting, I selected the <em>conditional column</em> option and entered the conditions as desired. I then changed the data type of the index columns to whole numbers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*kOyBbK96zPS6b3ygPmF8Rw.png" /><figcaption>After Custom Sorting</figcaption></figure><p><strong>Note:</strong> The above steps were repeated for the <em>balance </em>and <em>credit_score</em> columns.</p><p>Next, I renamed the columns where needed, so they are meaningful enough when they appear as title in the charts.</p><p>active_member = Activity Status</p><p>customer_id = Customer ID</p><p>churn = Churn Status</p><p>balance = Account Balance</p><p>products_number = Product Type</p><p>I also ensured all the columns had the right data type by checking the type indicated at the left hand side of the column name, and making changes where necessary.</p><p>In the end, I had 4 tables for this report. I clicked on <em>close and apply</em> which loaded the cleaned data (see below) onto the Power BI window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_cTcHh9rKNTlEShN9kqNQ.png" /><figcaption>cleaned data</figcaption></figure><p>5. <strong>Data Modelling</strong></p><p>Here, I explored the relationship between these tables and how they are connected. I also arranged them so that all the <em>fact tables</em> were at the top of the <em>dimension table</em>. This is to make visualisation easy. Power BI pre-detected the cardinality of the model relationship as many-to-one which is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkN7EbI7FtezFwEgc-L3KQ.png" /><figcaption>table</figcaption></figure><p>6. <strong>Visualization — Report</strong></p><p>I started the report by creating a few DAX measures.</p><p><strong><em>DAX</em></strong> simply means Data Analysis Expression. It is an expression that helps with calculations while building report. The three I created were:</p><ul><li>Customers(Number of customers)</li><li>Churn rate (%)</li><li>Customers Churned</li></ul><p><strong>Step</strong>:</p><p>On the right pane where the tables are listed, I right clicked on the <em>Customer Data</em> table, then selected <em>new measure</em>. I labeled the measure as <em>Customers</em> and used the formular below.</p><pre>Customers = DISTINCTCOUNT(&#39;Customer Data&#39;[Customer ID])</pre><p>This formula above counted all the unique ID in the <em>Customer ID</em> column.</p><p>I repeated the above steps for the<em> Customers Churned </em>and <em>Churn Rate</em> measure with the respective formulars below:</p><pre>Customers Churned = CALCULATE(COUNT(&#39;Customer Data&#39;[Churn Status]), &#39;Customer Data&#39;[Churn Status] = &quot;churned&quot;)<br><br>Churn Rate = &#39;Customer Data&#39;[Customers Churned]/&#39;Customer Data&#39;[Customers]</pre><ol><li>Customers: 10K</li><li>Customers churned: 2037</li><li>Churn Rate: 20.4% ( Changed to % from the measures tool tab)</li></ol><p>Finally, I built the report in the screenshot below, taking into account the key factors like account balance, age group, activity status, gender, credit score, e.t.c. and their effects on the churn rate. This helped me gain insights into where the bank could make neccessary improvements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNBPyQmRkkFb3umbzEfNzQ.png" /></figure><p>7. <strong>Insights</strong></p><ol><li>Churn rate for male customers is 65% but the overall male churn rate is at 25%.</li><li>In terms of those with credit card facility, the churn rate is highest amongst lowest credit score group of &gt;400</li><li>Surprisingly, the customers whose account balance are &lt;=200k are the most churned in terms of account balance.</li><li>Overall, Churn rate is very high at 56.2% for middle aged customers between 51–60 years of age.</li><li>For the products, churn rate is high @ 27.7% amongst customers in the Prod 1 group. The age account and credit score factors are same here. Similar situation for prod 2 =, however in prod 2, the churn rate is at all time 100% for customers between the 1k-1ok account balance.</li></ol><p>7. <strong>Recommendation</strong></p><ol><li>The stakeholders could consider creating products that target seniors close to their early retirement age to avoid losing them.</li><li>An incentive program could be considered for customers who have maintained longer relationship with the bank.</li><li>In the same way, an exclusive package such as travel and vacation packages, subsidized investment portfolio, e.t.c., could be considered for the customers in the &gt;200k account balance group, to reduce the rate at which they leave the bank.</li><li>The business needs to understand why there is 100% churn rate for Prod 2 customers with account balance of 1k-10k and how to get them back in business.</li></ol><p>In Summary, age group of 51–60, people with low credit scores and those with high account balance (&gt;200k) are most likely to churn. The bank should consider the recommendations above and other effective strategies that can address the findings, to better customer retention and reduce chrun rate.</p><p>8. <strong>Conclusion</strong></p><p>In this Power BI analysis, I went through some major data analysis process to get the data from raw to cleaned and onto building the report, ensuring data quality across board. Most importantly, it provided valuable insights into some of the major factors that encourage customer churn at the bank.</p><p>With this report, the stakeholders can better manage the churn situation (specifically for salaried customers), by focusing on the key factors and evaluating the results of their changes periodically.</p><p>Thank you for reading!</p><p>I will appreciate your feedback below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ade7bc95778" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bikestores - Visualization and Dashboard]]></title>
            <link>https://medium.com/@chinenyeagba/excel-visualization-and-dashboard-project-1006c1114db9?source=rss-e05c595e642b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1006c1114db9</guid>
            <dc:creator><![CDATA[Chinenye Agba]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 05:32:46 GMT</pubDate>
            <atom:updated>2023-05-03T00:22:28.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ki3GiS-_HzBtmSy9" /><figcaption>Image from Scotty Laughland (Komoot)</figcaption></figure><blockquote><strong>Introduction</strong></blockquote><p>Data Visualization is a simple, interactive and compelling way Data Analysts communicate analytical findings to stakeholders. It is a vital part of the ‘Share’ phase in data analysis as it allows you to easily identify trends and patterns, gain valuables insights from data, and share them in a simple, understandable, non-technical manner with stakeholders.</p><blockquote><strong><em>About this Project</em></strong></blockquote><p>I will be visualizing Bikestores datasets for the business executives and Sales Department of my (theoritical) Bikestores Orgnaization.</p><blockquote><strong><em>Business Task</em></strong></blockquote><p><em>“Identify trends in sales activity within the Organization, and share insights into the sales analysis between 2016–2018 period”</em></p><blockquote><strong><em>Workflow</em></strong></blockquote><ol><li>Understand the Problem</li><li>Data Collection and Gathering</li><li>Data Cleaning</li><li>Data Analysis and Visualization</li><li>Insights</li><li>Recommendation</li><li>Conclusion</li></ol><blockquote><strong>Understand the Problem</strong></blockquote><p>This inolves defining the project goals and laying out plans to find solutions with data. I had to ask questions to properly understand what the management wants. This helped avoid confusions, and I was also sure my analyses would align with project objectives.</p><blockquote><strong>The metrics:</strong></blockquote><ul><li>Revenue per year</li><li>Revenue per month</li><li>Revenue per state</li><li>Revenue per store</li><li>Revenue per store</li><li>Revenue per brand</li><li>Top 10 customers per revenue</li><li>Top performing sales representatives</li></ul><p>I decided to build an interactive dashboard that would contain all these metrics for ease of access, as a report may be too long and unmanageable for stakeholders’ use.</p><blockquote><strong>Data Collection and gathering</strong></blockquote><p>I had to gather data from various sources. Using SQL Query, I generated a detailed dataset from the company’s database which gave me all the information I needed. These were data collected by the are sales and production departments.</p><p>Note: Because this is a theoritical project, I first loaded the data into SQL with ‘Create Database’, ‘Create Schema’, ‘Create Table’ and ‘Alter Table’ scripts. I then extracted the relevant data from the database with the query below.</p><p>The full SQL script for this can be found on my GitHub account <a href="https://github.com/technwa/PortfolioProjects/blob/main/Bikestores.sql"><strong><em>here</em></strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgBpnt_gYLOpkDuL6fM5AA.png" /><figcaption>Data gathering in SQL</figcaption></figure><blockquote><strong>Data Cleaning</strong></blockquote><p>After I gathered the data above, I inspected each column to be sure there are no inconsistent, duplicate, null or incorrect data thst could affect my analysis. The data was confirmed clean in all aspects before I exported it to MS Excel for analysis. You can check <a href="https://medium.com/@chinenyeagba/data-cleaning-in-sql-82895aaa16d2"><strong><em>this article</em></strong></a> for an in depth Data Cleaning project in SQL.</p><blockquote><strong>Data Analysis</strong></blockquote><p>To analyse the data, I Connected my excel workbook to SQL in order to import directly from the database. This is best practice for importing data from one application to another. With this method, any changes made at the source (The database), would automatically apply to the workbook without you having to manually update them. This helps eliminate chances for error and maintain data format.</p><p>The generated and imported table contained 15,172 records and 12 rows, see below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prmFbGBHybeenZ7bi5AFrA.png" /><figcaption>Table Imported into Excel</figcaption></figure><p>I proceeded to create nine different Pivot tables. For the first two tables, I placed the year and month respectively in the ‘row’ quadrant, and the Revenue in the ‘values’ quadrant. The last four tables; brand, category, customers and sales representative, had the variable fields in the ‘row’ and the revenue in the ‘values’ as well.</p><blockquote><strong>Revenue per Year: </strong><em>For the first PivotT table, I created a simple Column chart to display the revenue earned from orders of bike in each of the three years (2016–2018).</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*CAk9QPOWfE1iLtvreFe6Iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*zxCXEc1LAZPHdWOaIUC-Zw.png" /><figcaption>Revenue Per Year</figcaption></figure><blockquote><strong>Revenue Per Month</strong>:<em> This second Pivot used the same data cache as the first one, but was grouped by month and year to show individual revenue by month, instead of just year. So, before I could create the Table, I had to decouple it from the data cache. Decoupling Pivot tables on the same worksheet, that share same data cache, prevents any changes on the new tables from affecting the old one.</em></blockquote><p>After that, i then created the pivot table and visualised it with a customised line chart, showing the month to year earnings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*Ca-Bfbd98kgg713qQhm8xA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*t_bmmhIFAEbBacwLa920Vg.png" /><figcaption>Revenue Per Month</figcaption></figure><blockquote><strong>Renevue per state:<em> </em></strong><em>The ‘state’ field has three unique records. Since these records are geographical data, I converted the Pivot table to regular range and visualised it in a map as shown below.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*71cmf5Ary5gCr8Zohm-0Ww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*3sKrKcuwFNk-vNmVpT2Uvg.png" /><figcaption>Revenue Per State</figcaption></figure><blockquote><strong>Revenue Per store</strong>:<em> There are three major stores where the organization sells bikes. I created a pie chart to show the percentage revenue for each store.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*kyIpW5JxDV0hosgigjqzsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*mYiuLegHWatcigzbGYo_SQ.png" /><figcaption>Revenue Per Store</figcaption></figure><blockquote><strong>Revenue Per Brand</strong>: <em>This Pivot table and chart looked at how the various bike brands earned over the years. I visualised it in a simple Bar chart with clear lables of each brand name and amount in revenue.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*qgcnHe0RAIN3WrJrilAt7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iouIIWtVQ5KoA5wgar28KA.png" /><figcaption>Revenue Per Brand</figcaption></figure><blockquote><strong>Revenue Per Category:</strong> <em>Similar to the previous pivot. this essentially showed how much revenue we made based on the different bike categories.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*FA-JfxLC43f2eA4I5f1X0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*D9OBGm0UoeGC4WWk1i4wMg.png" /></figure><blockquote><strong>Top Ten Customers: </strong><em>I created and sorted the table in descending order, so I could have the highest spending customers at the top. I went ahead to filter by top 10 as these are the ones my stakeholders were more interested in.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*tqU9r6JgE5yGiNSQR55Wlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*DJ9D9GsEqp9sHnqXW8oOrA.png" /><figcaption>Revenue per customer</figcaption></figure><p><strong><em>Top Ten Sales Representatives</em></strong>: Stakeholders also wanted to know the top performing representatives. I created the table and visualised the bar chart below to that effect, with clear labels to show their respective performances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*VBMOdJ95XvL_rugk9by0gA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*1O2oI_pZshOOtPnKC092aA.png" /><figcaption>Revenue per Sales Representatives</figcaption></figure><blockquote><strong><em>Dashboard 1: Excel</em></strong></blockquote><p>I created an Excel Dashboard with the above charts. I also added filter controls in form of slicers for interactivity. the three filters contain ‘year’, ‘city’ and ‘store name’. This will make it easy for the stakeholders to interact with the data, filter the dashboard and gain insights based on their preferred metric of interest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZ_wV9di2BLFr9mm1ul5cQ.png" /></figure><blockquote><strong><em>Dashboard 2: Tableau</em></strong></blockquote><p>I went ahead to visualise the same data on Tableau and built a more interactive dashboard. Tableau is a Business Intelligence tool and gives analysts an avenue to further explore their creativities. It provides Intelligent guide on how to visualise datapoints and structure dashboards as well.</p><p>I created eight charts in Tableau for this project, showing same measures and dimensions as in the excel dashboard above. After creating the charts, I had to design a banner, an action title and filter sheet</p><p>I would have a separate article on the details of this Tableau visulization, so I don’t make this one longer than expected.</p><p>You can view the Tableau Dashboard on <a href="https://public.tableau.com/views/BikeSalesDashboard_16795381430030/Dashboard1?:language=en-US&amp;:display_count=n&amp;:origin=viz_share_link"><strong><em>my Tableau Public page</em></strong></a></p><blockquote><strong><em>Insights</em></strong></blockquote><ul><li>The Sales Analysis shows that the best perfoming year for the time period analysed is 2017</li><li>The Trek brand of bikes as well as the Mountain Bikes category are the most profitable in all regions</li><li>The year 2017 was the peak revenue year across board with major sales recorded between the summer and fall months.</li><li>The Baldwin Bikes store in New York is the overall best performing store in terms of revenue, units sold and Top ten customers and best performing sales representatives.</li><li>Overall, the summer months are the peak period for sales. This could be because of the warmer days and numerious outdoor activities people engage in throughout summer seasons(More analysis needs to be done to substantiate if there is a correlation)</li></ul><blockquote><strong><em>Recommendation and conclusion</em></strong></blockquote><p>I recommeded that:</p><ol><li>more resources should be made available to the New York region/store for increased revenue.</li><li>Discounts or promotions can be offered to customers of the lower performing regions. This can boost customer retention and repeat purchase</li><li>The business should consider revisiting the marketing strategy employed in 2017, as that year alone generated 45% of the total revenue from all three years. This could prove useful in planning for the coming years.</li></ol><blockquote><strong><em>Conclusion</em></strong></blockquote><p>I presented the dashboard to the stakeholders explaining the insights and recommendations. I also enquired if they would require further metrics added to aid their decision making.</p><p>This project allowed me explore the Dashboard capabilites of excel and once again, Excel has proven to be such a valuable tool in Data Analytics. Business Intelligence tool like Tableau however, raises the bar on interactivity. So much that non technical collagues can make changes based on their interest, and immediately see the implication of those to the overall bottomline.</p><p>I enjoyed working on this project and got to add some new ‘tricks’ to my Data analyst tool kit.</p><p>If you read this far, consider engaging mbelow.</p><p>Thanks!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1006c1114db9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Cleaning in SQL]]></title>
            <link>https://medium.com/@chinenyeagba/data-cleaning-in-sql-82895aaa16d2?source=rss-e05c595e642b------2</link>
            <guid isPermaLink="false">https://medium.com/p/82895aaa16d2</guid>
            <category><![CDATA[microsoft-sql-server]]></category>
            <category><![CDATA[data-cleaning]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Chinenye Agba]]></dc:creator>
            <pubDate>Sat, 18 Mar 2023 19:26:12 GMT</pubDate>
            <atom:updated>2023-03-20T19:27:00.251Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Nashville Real Estate Data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*jFRtjaPQkJaF5XVDm_BKEw.jpeg" /><figcaption>Photo from <a href="https://www.nanaimore.com/university-district-homes-for-sale/">nanaimore</a></figcaption></figure><p><strong>Introduction</strong></p><p>Data Analysts are known to Analyse data and draw useful insights which can help businesses plan, strategize, improve processes, increase revenue and stay ahead of the competition. However, before any dataset can be analysed, it has to be <strong><em>cleaned</em></strong> and prepared for use.</p><p><strong>Data Cleaning</strong></p><p>This is the process of formatting and transforming a dirty data into clean one. It includes appropriate transformation of incorrect, duplicate, incomplete and inconsistent data so it can be useful for Data Analysis. This is a very crucial step in the analytical process to ensure data integrity and accuracy in the end result of any analysis.</p><p><strong>About This Data</strong></p><p>This project involves cleaning of the Nashville real estate data with SQL. Housing information captured in the data which can be found <a href="https://github.com/AlexTheAnalyst/PortfolioProjects/blob/main/Nashville%20Housing%20Data%20for%20Data%20Cleaning.xlsx">here</a>, contain lots of errors, incorrect datatypes inconsitencies and duplicates which were corrected and formatted using SQL.</p><p><strong>My Data Cleaning Guide:</strong></p><ol><li>Check and convert fields to appropriate datatypes where neccessary</li><li>Add new relevant fields</li><li>Check and fix inconsistencies in data</li><li>Extract values and format fields into useful data</li><li>Remove unwanted data and duplicates</li><li>Create View of the cleaned relevant data</li></ol><p><strong>Data Cleaning Process</strong></p><p>I downloaded the dataset from the link above as an excel file. The table contained 56,477 records and 19 fields. I proceeded to load same into Microsoft SQL Server for cleaning. Here, I previewed the entire table to familiarise with the fields (columns) of the data and their data types.</p><p>I was able to immediately identify that the ‘Sale Date’ field was in the datetime format, so I converted to just date as there was no time data included.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*tGu7yv1dxbN_mscIES-8lQ.png" /><figcaption>SaleDate</figcaption></figure><p>I had to create a new field where the converted data will be placed, followed by an UPDATE statement to input the converted data into the new field. I used this approach because the express coversion did not work for the existing field. See script below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EESnuqx0HF33lmWbxKdbpg.png" /></figure><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/98/1*JYhyoi6OkkeGHo0zT3RWlw.png" /><figcaption>Converted SalesDate</figcaption></figure><p>Next, I checked the ‘Property Address’ field and found that it had some null records. However, these nulls were duplicates of another record with the same ‘Parcel ID’ but different ‘UniqueID’, and the missing address appeared to be present in either of these duplicates. So, to retrieve the missing addresses, I wrote the script below to update the table by joining the table to itself in the Update statement; using ‘Parcel ID’ as the primary key AND where ‘unique ID’ in both tables are not equal. Also, I included the ISNULL function to replace these nulls with the corresponding values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IooduwcwZktSxKCrhGnf_Q.png" /></figure><p>My next action was to then split the ‘Property Address’ field in order to separate the Street from the City name. Reason for this is because the data is more useful this way especially in visualization. The field originally looked like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*-err3UjVMvlbOD6tzMqQ2w.png" /></figure><p>With the PARSENAME funtion in the script below, I replaced the comma delimiter in the address with period (fullstop). First, I created new fields where the split address will be placed. Then in the UPDATE statement, I used the PARSENAME function to essentially split the values based on the delimiter into street and city and place them in their respective new fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuPFGZISWSzQ-E2eLGT2Aw.png" /></figure><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*mMMJbiujM6cn7KMz8lLXHw.png" /></figure><p>Next, was to replicate the same step above, on the ’Owner Address’ field. The addreses contained street, city and state names seperated by comma delimiters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*uizcaZngHSVzUMx_ysBKBQ.png" /></figure><p>See script below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZaoD4f4h4JpaQG0_bgRPw.png" /></figure><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*x0CRCqa8F84q-kfjEEnG3A.png" /></figure><p>Next, I took a distinct count of the ‘Sold As Vacant’ field and discovered that the entries were Yes, Y, No and N. I then updated the table by replacing all the Y as Yes and N as No as with the script below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qt6cHTKhVKrAu9eOY9torw.png" /></figure><p>Next, I carefully checked all relevant fields that would be useful for further analysis and confirmed they were formatted correctly.</p><p>At this point, I proceeded to delete duplicates in the table with a CTE and Row_Num function which I partitioned by the unique fields in the table. This was to help filter out the duplicates. First was to confirm there were duplicates using the SELECT statement with the CTE. Once confirmed, i then used the DELETE statement on the CTE to remove them. I left this deletion for later to ensure I have recovered all useful data from these fields before permanent removal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z62wmV3ryFwQoGjl0x4cgQ.png" /></figure><p>Finally, I dropped unimportant fields that are not relevant to further analysis, such as the fields I converted and split previously into new ones while transforming this data, and the ‘Tax District’ field.</p><p>Next, I created new fields with clearer labels for than the ones I aliased previously. I followed this with an update statement to transfer the data from these alias fields, to their repsective new fields as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFpuEshUUrBjLwFsdTKPIQ.png" /></figure><p>Once transferred, I also dropped the old Columns from the table with the ALTER TABLE statement.</p><p>Finally, I created a View of my preferred data with the script below and reordered the fields logically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hd3PU42S6LHbxe2lVQVEhw.png" /></figure><p><strong><em>Note</em></strong>: Before running each script that is not a SELECT statement, I would run it in a SELECT statement to get a preview of what the output would look like. After each alteration, I again previewd the table with the SELECT statement to confirm that the intended change was appropriately effected.</p><p>The final result is the table screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2MB8Nly6khGEjmXFFsEsg.png" /></figure><p>To view the cleaned data, click <a href="https://docs.google.com/spreadsheets/d/1_HvJgMEh2ztaMIICqa_jOSBxervpk0d6jE724wIogWo/edit?usp=sharing">here</a>.</p><p>Also, you can view the entire script on <a href="https://github.com/technwa/PortfolioProjects/blob/main/Data%20Cleaning%20in%20SQL.sql">Github</a>.</p><p>In the cleaned data, there are srill presence of some null records because I am not able to retrieve those anywhere. Nonetheless, the fields which vital to the analysis of this data; such as</p><p><strong>Conclusion</strong></p><p>A clean Data is the baseline for a trusworthy data exploration and analysis. It is a crucial step that cannot be ignored or else, you would be left with data that is all over the place which you cannot make any useful meaning out of.</p><p>Cleaning data in SQL is very fast, and an optimised method to work on large amount of Data, a process that may be slower if done in spreadsheet. This project has shown that beauty of data cleaning processes especially on SQL and how the end result is a well organised, meaningful data to be used for further analysis.</p><p>Thanks for reading!</p><p>I will be glad to read your feedbacks and comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82895aaa16d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>