<?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 Jesupelumi Afolayan on Medium]]></title>
        <description><![CDATA[Stories by Jesupelumi Afolayan on Medium]]></description>
        <link>https://medium.com/@jayphee?source=rss-75439806c059------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kTuB2zFEyDrmyL9aBX4QYw.jpeg</url>
            <title>Stories by Jesupelumi Afolayan on Medium</title>
            <link>https://medium.com/@jayphee?source=rss-75439806c059------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:40:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jayphee/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[Understanding the Key Drivers of No-Show Rates in Appointments: Insights from Data Analysis using…]]></title>
            <link>https://medium.com/@jayphee/understanding-the-key-drivers-of-no-show-rates-in-appointments-insights-from-data-analysis-using-7005d0f69a0b?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/7005d0f69a0b</guid>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Tue, 24 Dec 2024 12:17:34 GMT</pubDate>
            <atom:updated>2024-12-24T12:17:34.755Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Understanding the Key Drivers of No-Show Rates in Appointments: Insights from Data Analysis using SQL</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*oWH6y7tIWKTSy-tH1svoig.jpeg" /><figcaption>Image gotten from <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fcygnusgastro.com%2Fgastroenterology-hyderabad%2Fbook-doctor-appointment-thank-you%2F&amp;psig=AOvVaw2TFtEQlBKUPHGuYErwgpM9&amp;ust=1735116580792000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBQQjRxqFwoTCIDMqLD7wIoDFQAAAAAdAAAAABAZ">here</a></figcaption></figure><p>No-shows are a common challenge in various sectors, particularly healthcare, where missed appointments can impact delivery and efficiency. I examined the factors influencing no-show rates in appointment scheduling through data analysis using SQL.</p><p>In this post, I will share key insights from the data, including the role of gender, age, health conditions, appointment scheduling intervals, and the effectiveness of SMS reminders. By understanding these trends, we can better address the reasons behind no-shows and implement strategies to improve attendance and optimize appointment management.</p><p><strong>DATA SOURCING AND INFORMATION: </strong>The dataset was obtained from the Kaggle website. You can access it <a href="https://www.kaggle.com/datasets/joniarroba/noshowappointments/data">here</a>. The dataset contains 14 columns;</p><p>PatientId, AppointmentID, Gender, AppointmentDay, ScheduledDay, Age, Neighbourhood, Scholarship (True or False), Hipertension (True or False), Diabetes (True or False), Alcoholism (True or False), Handicap (True or False), SMS_received (1 or more messages sent to the patient), No-show (True or False.)</p><p>I loaded the CSV file into the MySQL workbench and it contained 110,527 rows. Then the first thing I did was to duplicate the table because it provides a backup, allowing me to experiment or make changes without risking the integrity of the original data and I did that with this query;</p><pre>SELECT *<br>FROM med_appointment_cleaned; -- the original table name<br><br>-- Duplicating the table<br>CREATE TABLE med_appointment_dup<br>LIKE med_appointment_cleaned;<br><br>INSERT INTO med_appointment_dup<br>SELECT *<br>FROM med_appointment_cleaned;<br><br>SELECT * <br>FROM med_appointment_dup; -- the duplicated table I&#39;ll be working on now</pre><p>Then I checked for duplicate records in the table. I Carried that out using this query;</p><pre>-- Checking for duplicates in the table<br>SELECT AppointmentID, COUNT(*)<br>FROM med_appointment_dup<br>GROUP BY AppointmentID<br>HAVING COUNT(*) &gt; 1;<br><br>-- There are no duplicates</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Vm6sv6qXU7RuxDf2P1KonA.png" /><figcaption>This showed that there were no duplicates</figcaption></figure><p>During my EDA, I discovered that a total of 110,527 appointments were made. Of these, 22,319 appointments were missed (no-show), while 88,208 were attended. This resulted in a no-show rate of 20.19%, calculated using the following query:</p><pre>-- Exploratory Data Analysis<br><br>SELECT<br>    COUNT(*) AS total_appointments,  -- Total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,  -- Total number of times patient missed appointment<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,  -- Total number of times patient attended appointment<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage  -- No-show rate percentage (when patient didn&#39;t show up) <br>FROM med_appointment_dup;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNZ_k88Cx3GfMVH1l0uyBg.png" /></figure><p><strong>No-show rate percentage by gender</strong><br>Out of the 110,527 total appointments, 71,840 were female, 28687 were male. 14,594 of the females missed their appointments, that’s 20.3%<br>while 7,725 of the males missed their appointments; 19.97%. I did this with this query;</p><pre>-- No-show rate percentage by gender<br>SELECT Gender,<br> COUNT(*) AS total_appointments,  -- Total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,  -- Total number of times patient missed appointment<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,  -- Total number of times patient attended appointment<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY Gender;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gqbx0zZqqiX_fpNp_qqO8A.png" /></figure><p>The no-show rate by age group revealed the following insights: Middle-aged adults (35–64 years) had the highest number of total appointments, with a no-show rate of 18.6%. Young adults (18–34 years) recorded the highest no-show rate at approximately 24%, while older adults had the lowest no-show rate at 15.5%. This was done with this query;</p><pre>-- no-show rate by age group<br>SELECT<br> CASE<br>  WHEN age &lt; 18 THEN &#39;Children&#39;<br>        WHEN age BETWEEN 18 AND 34 THEN &#39;Young Adults&#39;<br>        WHEN age BETWEEN 35 AND 64 THEN &#39;Middle-aged Adults&#39;<br>        ELSE &#39;Old-aged&#39;<br> END AS age_group,<br>    COUNT(*) AS total_appointments,  -- Total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,  -- Total number of times patient missed appointment<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,  -- Total number of times patient attended appointment<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY age_group<br>ORDER BY 2 DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQPMoWoimkce_0wQyI5d2Q.png" /><figcaption>Result for the no-show rate by age-group</figcaption></figure><h4><strong>No-show rate by appointment day</strong></h4><pre>-- No-show Rate Percentage by Appointment Day<br>SELECT <br>    DAYNAME(AppointmentDay) AS appointment_day,<br>    COUNT(*) AS total_appointments,  -- Total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,  -- Total number of times patient missed appointment<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,  -- Total number of times patient attended appointment<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY appointment_day<br>ORDER BY 2 DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Jr1zaVyJy23-XX9VLF0EA.png" /></figure><p>First, it was observed that appointments were scheduled only on six days of the week: Sunday through Friday. Tuesday had the highest number of appointments, with 25,867, while Friday had just 39 appointments. Wednesdays recorded the lowest no-show rate percentage, whereas Fridays had the highest, likely due to the small number of appointments made on that day.</p><h4><strong>Impact of SMS reminders</strong></h4><pre>-- Impact from SMS reminders<br>SELECT<br>    CASE <br>        WHEN SMS_received = 1 THEN &#39;Yes&#39;<br>        WHEN SMS_received = 0 THEN &#39;No&#39;<br>    END AS SMS_received,  -- Convert numeric 1 and 0 to Yes/No<br>    COUNT(*) AS total_appointments,  -- Total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,  -- Total no-shows<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,  -- Total yes-shows<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage  -- No-show rate as percentage<br>FROM med_appointment_dup<br>GROUP BY SMS_received;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZqThF7Du7cr-3ssXoqxWQ.png" /></figure><p>Out of the 110,527 total appointments, 75,045 patients did not receive SMS reminders, yet a high percentage of them attended their appointments. Interestingly, 35,482 patients received SMS reminders, but 27.6% of them still missed their appointments, compared to only 16.7% of those who didn’t receive SMS. This indicates that SMS reminders did not significantly influence attendance.</p><h4><strong>Trends in appointment attendance across gender and age groups.</strong></h4><pre>-- difference in no-show rates between male and female patients<br>SELECT gender,<br> CASE<br>  WHEN age &lt; 18 THEN &#39;Children&#39;<br>        WHEN age BETWEEN 18 AND 34 THEN &#39;Young Adults&#39;<br>        WHEN age BETWEEN 35 AND 64 THEN &#39;Middle-aged Adults&#39;<br>        ELSE &#39;Old-aged&#39;<br> END AS age_group,<br>    COUNT(*) AS total_appointments, -- total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows, -- total number of no-shows<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows, -- total number of yes-shows<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END)/ COUNT(*) * 100 AS no_show_percentage<br>FROM med_appointment_dup<br>GROUP BY gender, age_group<br>ORDER BY 3 DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8JvKknghBCNgTSoOfgohA.png" /></figure><p>Middle-aged adults are the most reliable group for attending appointments, with men being slightly more dependable than women. Younger groups, particularly young women, have the highest no-show rates, reaching up to 24%. Children also exhibit higher no-show rates, regardless of gender. In contrast, older adults are the most consistent, with both men and women attending their appointments most of the time.</p><h4><strong>No-show rate of Patients with and without scholarships</strong></h4><pre>-- no-show rate of patients with and without scholarship<br>SELECT <br> CASE<br>  WHEN Scholarship = 1 THEN &#39;Yes&#39;<br>        ELSE &#39;No&#39;<br> END AS scholarship_status,<br>    COUNT(*) AS total_appointments, -- total number of appointments<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows, -- total number of no-shows<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows, -- total number of yes-shows<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END)/ COUNT(*) * 100 AS no_show_percentage<br>FROM med_appointment_dup<br>GROUP BY scholarship_status;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KoSMR2k42CFFrHHCG91C4w.png" /></figure><p>People without scholarships accounted for the majority of appointments, with a no-show percentage of 19.81%, while those with scholarships had a higher no-show rate of 23.74%. Despite having fewer total appointments, scholarship recipients are less likely to attend, which might point to underlying barriers or challenges affecting their ability to follow through on commitments.</p><h4><strong>No-show rate by hypertension</strong></h4><p>I decided to check the number of patients who had hypertension and see how well they showed up for their appointments. This is the query I used to get that.</p><pre>SELECT<br>    CASE<br>        WHEN Hipertension = 1 THEN &#39;Yes&#39;<br>        ELSE &#39;No&#39;<br>    END AS hypertension_Status,<br>    COUNT(*) AS total_appointments,<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY hypertension_Status;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_jr9rDeVHnc2Uxn1OkX-yg.png" /></figure><p>This shows that individuals with hypertension are more reliable in attending their appointments compared to those without hypertension. Patients with hypertension have a no-show rate of 17.30%, which is significantly lower than the 20.90% no-show rate for those without hypertension. This trend suggests that individuals with hypertension may prioritize their healthcare appointments more consistently, possibly due to a greater awareness of their health needs.</p><h4><strong>Cross-analyzing with gender</strong></h4><p>Then I decided to cross-analyze with gender using this query;</p><pre>-- Cross analyzing with gender<br>SELECT<br> Gender,<br>    CASE<br>        WHEN Hipertension = 1 THEN &#39;Yes&#39;<br>        ELSE &#39;No&#39;<br>    END AS hypertension_Status,<br>    COUNT(*) AS total_appointments,<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY hypertension_Status, Gender<br>ORDER BY 3 DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47ie_QkcYRrazTN0g-GqPg.png" /></figure><p>This reveals that gender and hypertension status both influence appointment attendance. Women without hypertension have the highest no-show rate at 21.13%, slightly higher than men without hypertension at 20.51%. However, individuals with hypertension, regardless of gender, are more reliable in attending appointments, with women showing a no-show rate of 17.32% and men at 17.25%.</p><h4><strong>No-show rate by diabetes cross-analyzing with age-group</strong></h4><p>I decided to check the number of patients with diabetes cross analyzing them with age-group. I Solved that with this query;</p><pre>-- No show rate by Diabetes and cross-analyzing with age-group<br>SELECT<br>    CASE<br>        WHEN Diabetes = 1 THEN &#39;Yes&#39;<br>        ELSE &#39;No&#39;<br>    END AS diabetes_status,<br>    CASE<br>  WHEN age &lt; 18 THEN &#39;Children&#39;<br>        WHEN age BETWEEN 18 AND 34 THEN &#39;Young Adults&#39;<br>        WHEN age BETWEEN 35 AND 64 THEN &#39;Middle-aged Adults&#39;<br>        ELSE &#39;Old-aged&#39;<br> END AS age_group,<br>    COUNT(*) AS total_appointments,<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY diabetes_status, age_group<br>ORDER BY 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ynstQ4Abs_5_t7SEfFZFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3CSDfxxmO6O0gqtSJEEoA.png" /></figure><p>This highlights significant differences in appointment attendance based on diabetes status and age group. Among those without diabetes, older adults have the lowest no-show rate at 15.00%, followed by middle-aged adults at 18.65%. Children and young adults without diabetes are less reliable, with no-show rates of 21.89% and 23.95%, respectively. For individuals with diabetes, middle-aged adults remain the most reliable, with a no-show rate of 18.05%, while young adults and children have notably higher rates at 28.13% and 31.37%, respectively. These trends suggest that younger individuals, particularly those with diabetes, may require additional support or interventions to ensure better attendance at appointments.</p><h4><strong>No-show rate by Alcoholism and cross-analyzing with gender</strong></h4><p>I decided to check the number of patients with alcoholism cross-analyzing them with gender, solved that with this query;</p><pre>-- No show rate by Alcoholism and cross-analyzing with gender<br>SELECT<br>    CASE<br>        WHEN Alcoholism = 1 THEN &#39;Yes&#39;<br>        ELSE &#39;No&#39;<br>    END AS alcoholism_status,<br>    Gender,<br>    COUNT(*) AS total_appointments,<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS total_no_shows,<br>    COUNT(CASE WHEN `No-show` = &#39;No&#39; THEN 1 END) AS total_yes_shows,<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY alcoholism_status, Gender;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EF4920RlWmwiSeucxlWTkg.png" /></figure><p>This reveals distinct patterns in appointment attendance based on alcoholism status and gender. Among individuals without alcoholism, men and women have comparable no-show rates, with women at 20.23% and men slightly lower at 20.13%. However, for individuals with alcoholism, men are significantly more reliable, with a no-show rate of 17.27%, compared to women, whose no-show rate is much higher at 25.18%.</p><h4><strong>Appointment Scheduling Trends</strong></h4><p>I examined whether there was a correlation between how far in advance an appointment was scheduled and the likelihood of a no-show. Using the scheduled day and appointment day columns, I calculated the time difference between when the appointment was scheduled and when it took place. The analysis focused on determining if patients who scheduled appointments closer to the appointment date were more likely to miss them. This was achieved using the following query:</p><pre>SELECT<br>    CASE<br>        WHEN DATEDIFF(AppointmentDay, ScheduledDay) BETWEEN -1 AND 0 THEN &#39;Same Day&#39;<br>        WHEN DATEDIFF(AppointmentDay, ScheduledDay) BETWEEN 1 AND 5 THEN &#39;1-5 Days&#39;<br>        WHEN DATEDIFF(AppointmentDay, ScheduledDay) BETWEEN 6 AND 10 THEN &#39;6-10 Days&#39;<br>        ELSE &#39;10+ Days&#39;<br>    END AS Scheduling_Interval,<br>    COUNT(*) AS total_appointments,<br>    COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) AS no_shows,<br>    (COUNT(CASE WHEN `No-show` = &#39;Yes&#39; THEN 1 END) / COUNT(*)) * 100 AS no_show_rate_percentage<br>FROM med_appointment_dup<br>GROUP BY Scheduling_Interval<br>ORDER BY FIELD(Scheduling_Interval, &#39;Same Day&#39;, &#39;1-5 Days&#39;, &#39;6-10 Days&#39;, &#39;10+ Days&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwB82hSiZWxTDG3seLHhIQ.png" /><figcaption>The DATEDIFF function in SQL is used to calculate the difference in days between two dates</figcaption></figure><p>This reveals that as the scheduling interval increases, the no-show rate also rises. For appointments scheduled on the same day, the no-show rate is relatively low at 6.61%. However, for appointments scheduled 1–5 days in advance, the no-show rate climbs to 24.25%. The no-show rate further increases for appointments scheduled 6–10 days in advance (28.20%) and reaches the highest point of 32.55% for appointments scheduled more than 10 days ahead. This suggests that the longer the waiting period for an appointment, the higher the likelihood of no-shows.</p><h4><strong>Conclusion:</strong></h4><p>1. Overall No-Show Rate: The overall no-show rate for appointments is 20.19%, with 22,319 out of 110,527 appointments missed. This highlights a significant portion of appointments that are not attended.</p><p>2. No-Show Rate by Gender: The no-show rate is slightly higher for females (20.3%) compared to males (19.97%). Despite this, the difference is minimal, suggesting gender may not be a major determinant in no-show behaviour.</p><p>3. No-Show Rate by Age Group: Young adults (18–34 years) have the highest no-show rate at around 24%, while older adults (65+) have the lowest at 15.5%. This indicates that older adults are more consistent in attending their appointments.</p><p>4. Impact of SMS Reminders: Interestingly, SMS reminders seem to have little effect on reducing no-shows. Of the 35,482 patients who received SMS reminders, 27.6% missed their appointments, compared to 16.7% for those who did not receive reminders. This suggests that other factors beyond reminders may influence attendance more strongly.</p><p>5. No-Show Rate by Health Conditions: Patients with hypertension tend to be more reliable in attending their appointments, with a lower no-show rate of 17.30% compared to 20.90% for those without hypertension. Similarly, individuals with diabetes or alcoholism show varying levels of reliability, with those without these conditions generally attending appointments more consistently. This could point to individuals with chronic conditions being more motivated to attend due to the perceived urgency of their health needs.</p><p>6. No-Show Rate by Scholarships: Those with scholarships show a higher no-show rate (23.74%) compared to those without scholarships (19.81%).</p><p>7. No-Show Rate by Appointment Scheduling: The no-show rate increases as the time between appointment scheduling and the actual appointment grows. For appointments scheduled on the same day, the no-show rate is the lowest at 6.61%, while for those scheduled more than 10 days in advance, the no-show rate reaches 32.55%. This suggests that the longer the interval, the more likely patients are to forget or cancel their appointments.</p><p>8. Trends Across Gender and Age: Middle-aged adults are the most reliable demographic in showing up for appointments, with men slightly outperforming women. Younger groups, particularly young women, have the highest no-show rates.</p><p>These findings highlight several factors influencing no-show rates, including gender, age, health conditions, and scheduling practices.</p><p>Addressing these factors with personalized interventions could make a big difference in reducing no-show rates and encouraging patients to stick to their appointments.</p><p>Thank you for reading, I’ll appreciate your comments, feedback, or suggestions in the comment box.</p><blockquote>Let’s connect on <a href="http://www.linkedin.com/in/jesupelumi-afolayan"><em>Linkedln</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7005d0f69a0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis — SQL: A Dive into Company Layoff Data.]]></title>
            <link>https://medium.com/@jayphee/exploratory-data-analysis-sql-a-dive-into-company-layoff-data-a9aac5763849?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9aac5763849</guid>
            <category><![CDATA[data-exploration]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 17:43:07 GMT</pubDate>
            <atom:updated>2024-09-16T17:43:07.432Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploratory Data Analysis — SQL: A Dive into Company Layoff Data.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ljEW72Vb7pzmzC_EPCd5zg.png" /><figcaption>This image was gotten from <a href="https://www.javatpoint.com/what-is-exploratory-data-analysis">here</a></figcaption></figure><p>Exploratory Data Analysis (EDA) is a critical step in data analysis, used to summarize the main characteristics of a dataset and uncover underlying patterns. In SQL, EDA involves querying the data to gain insights, check distributions, and identify relationships between variables without visualizations.</p><p>After cleaning a company layoff dataset using MySQL, I decided to take a deeper dive by performing a little EDA. In this post, I’ll share the findings from my data exploration.</p><blockquote>It is important to clean the data before exploring into it, hence my data cleaning process of the dataset can be found <a href="https://medium.com/@jayphee/preparing-a-layoff-data-for-analysis-a-data-cleaning-journey-using-sql-01e869efecdb">here</a>. The datset was gotten from <a href="https://www.kaggle.com/datasets/theakhilb/layoffs-data-2022">Kaggle</a></blockquote><p>The first insight I intended to derive was the sum of the total laid-off count by company. I used this query;</p><p>SELECT SUM(Laid_Off_Count) AS Total_layoffs, Company<br>FROM layoffs_data_staging<br>GROUP BY Company<br>ORDER BY 1 DESC;</p><p>Since SUM is an aggregated function, hence the use of the GROUP BY.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMRylYtXyOJPN98hrwp-xQ.png" /></figure><p>As seen, Amazon has the highest laid-off count with Meta and Tesla coming second and third respectively.</p><p>Now let’s say I want to find the total laid-off count made by Google company, I’d use this query</p><p>SELECT SUM(Laid_Off_Count), Company<br>FROM layoffs_data_staging<br>WHERE Company = ‘Google’<br>GROUP BY Company;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdJfBkjKqhvHbfWFyBC_Gw.png" /></figure><p>This shows us that 13472 employees were laid off by Google. Now if I were to find the total laid-off count for another company, I just have to insert the company name there.</p><p>I went further to get to know the earliest and latest laid-off date. This was the query I used;</p><p>SELECT MIN(`Date`), MAX(`Date`)<br>FROM layoffs_data_staging;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JEOt1x82xBur6HQwXa_t2g.png" /></figure><p>Hence the earliest layoff date was March 11th, 2020 and the latest was June 5th, 2024.</p><p>Another insight to be derived was the total laid-off count by country and this was done with this query;</p><p>SELECT Country, SUM(Laid_Off_Count)<br>FROM layoffs_data_staging<br>GROUP BY Country<br>ORDER BY 2 DESC;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRPHUhBuSfDdaUi4_K1w8A.png" /></figure><p>The United States had the most laid off count with 367830 employees laid off.</p><p>Next up on my insight list was to find the total laid-off count by year and this was achieved with this query;</p><p>SELECT YEAR(`date`), SUM(Laid_Off_Count)<br>FROM layoffs_data_staging<br>GROUP BY YEAR(`date`)<br>ORDER BY 1;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CcxRJEhapo7z1R_zXb7vZA.png" /></figure><p>And as seen there was a significant amount of layoffs in the years 2022 and 2023 and despite 2024 not being over, the total layoffs are more than the layoffs in 2020.</p><p>I wanted to find the total layoffs by stage of the company, and companies in POST-IPO (Essentially, Post-IPO means the company has transitioned from private to public and is now operating under public market conditions) had the highest layoffs totaling up to 290594 and this was gotten with this query;</p><p>SELECT Stage, SUM(Laid_Off_Count)<br>FROM layoffs_data_staging<br>GROUP BY Stage<br>ORDER BY 2 DESC;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZT734M1QD8qXOupY67eAA.png" /></figure><p>I also decided to find out the total layoffs by each month. The initial dataset date column had the year, month, and day values and I just needed the month and year values instead so I used this query to find that out;</p><p>SELECT SUBSTRING(`date`,1,7) AS `MONTH`, SUM(Laid_Off_Count) AS Total_Layoffs<br>FROM layoffs_data_staging<br>GROUP BY `MONTH`<br>ORDER BY 2 DESC;</p><p>The SUBSTRING() function extracts a portion of the string from the date column. Here’s a breakdown of how it works:</p><p>SUBSTRING(‘date’, 1, 7): This extracts the first 7 characters of the date string, starting from position 1. Thus, the SUBSTRING function is being used here to group the data by month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYOdKACgwBbwwpmhIadUrw.png" /></figure><p>Then the month with the highest layoffs was January in 2023 with a total of 70935 layoffs.</p><p>The next insight for me to derive was Rolling total over each month. So I used a CTE (A C<strong>ommon Table Expression </strong>in SQL is a temporary result set that you can reference within a select, insert, update, or delete statement. It is typically used to simplify complex queries by breaking them into smaller, more manageable parts. CTEs are defined using the ‘with’ keyword and exist only for the duration of the query they&#39;re part of) to find the rolling total;</p><p>WITH Rolling_Total AS<br>(<br>SELECT SUBSTRING(`date`,1,7) AS `MONTH`, SUM(Laid_Off_Count) AS Total_Layoffs<br>FROM layoffs_data_staging<br>GROUP BY `MONTH`<br>ORDER BY 1 ASC<br>)<br>SELECT `MONTH`, Total_layoffs, SUM(Total_Layoffs) OVER (ORDER BY `MONTH`) AS Rolling_total<br>FROM Rolling_Total;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATpW0rVD3lFdXYUe4MuFTQ.png" /></figure><p>After creating the CTE I selected the month, the total layoffs, and then the sum of the total layoffs ordering them by each month.<br>So the total layoffs in March 2020 were 8981, and the total layoffs for April 2020 were 25271, hence the rolling total over these two months was 34252.</p><p>Then I wanted to find out the top 5 companies with the highest layoffs in each year. This was done with this query;</p><p>WITH Company_Year (Company, Years, Total_Layoffs) AS<br>(<br>SELECT Company, YEAR(`date`), SUM(Laid_Off_Count)<br>FROM layoffs_data_staging<br>GROUP BY Company, YEAR(`date`)<br>), <br>Company_Year_Rank AS<br>(<br>SELECT *,<br>DENSE_RANK () OVER (PARTITION BY Years ORDER BY Total_layoffs DESC) AS Ranking <br>FROM Company_Year<br>)<br>SELECT * <br>FROM Company_Year_Rank<br>WHERE Ranking &lt;= 5;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DG5oKzw-v8Z1mlm6c23sTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zO6cNBAXDpQpu4MaOCxPFQ.png" /></figure><p>So I created a CTE named Company_Year and Company_Year_Rank respectively.</p><p>In the Company_Year CTE, I selected the Company, years, and total layoffs from the table and grouped them by company and date.</p><p>While in the Company_Year_Rank CTE, I selected;</p><p><strong>DENSE_RANK</strong>: A window function that assigns a ranking to each company.</p><p><strong>PARTITION BY YEARS</strong>: Resets the ranking for each year, meaning each year has its own set of ranked companies.</p><p><strong>ORDER BY Total_Layoffs</strong>: Orders the companies by the total number of layoffs in descending order (companies with the highest layoffs get the highest rank).<br>I then selected from Company_Year_Rank where the ranking is less than or equals 5 and here is the result;</p><p>In 2020 Uber was the company with the highest total layoffs with a total of 7525. In 2021, 2022, 2023, and 2024, Bytedance, Meta, Amazon, and Tesla were the companies with the highest layoffs respectively.</p><p>To confirm the query was right, I checked using another query;</p><p>SELECT Company, SUM(Laid_Off_Count)<br>FROM layoffs_data_staging<br>WHERE Company = ‘Uber’ AND YEAR(`date`) = 2020;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nkC9sBYCO9txk2Y-tLbvw.png" /></figure><p>It checks out with the previous query.</p><p>The last insight I derived was the total layoffs by Industry and this was done by using this query;</p><p>SELECT Industry, SUM(Laid_Off_Count) AS Total_layoffs<br>FROM layoffs_data_staging<br>GROUP BY Industry<br>ORDER BY 2 DESC;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-7iiUmpIzraA1pGQtGXUg.png" /></figure><p>The retail industry took the biggest hit because 67368 people were laid off, next was Consumer and transportation with 63814 and 57913 layoffs respectively.</p><p><strong>CONCLUSION</strong></p><p>Through exploratory data analysis (EDA) on the company layoff dataset, several key insights were uncovered:</p><ol><li><strong>Total Layoffs by Company</strong>: A significant variation in layoffs was observed across companies, with some companies experiencing a much higher number of layoffs compared to others. Google, for example, had a substantial total layoff count.</li><li><strong>Time Analysis</strong>: The <strong>earliest and latest layoff dates</strong> were identified, helping frame the timeline for the layoffs in the dataset.</li></ol><ul><li>The <strong>month with the highest layoffs</strong> was also highlighted, providing insight into when layoffs peaked.</li><li>A <strong>rolling total</strong> was calculated to observe how layoffs accumulated over time.</li></ul><p>3<strong>. Country and Industry</strong>: Layoffs were further analyzed by <strong>country</strong> and <strong>industry</strong>, revealing the regions and sectors most affected. Certain industries and countries bore the brunt of the layoffs, indicating a concentrated impact in specific areas.</p><p>4<strong>. Yearly and Monthly Trends</strong>: Layoffs were grouped by year and month, showcasing trends over time. This revealed which years and months experienced the most layoffs and helped identify potential patterns in the data.</p><p>5<strong>. Company Stage</strong>: Companies at different stages (e.g., startup, post-IPO) experienced varying degrees of layoffs, providing context about the companies’ growth phases and their corresponding challenges.</p><p>6. <strong>Top 5 Companies by Layoffs</strong>: By ranking companies based on their layoffs each year, the analysis highlighted the top 5 companies with the highest layoffs for each year. This brought out key players involved in mass layoffs and the scale of their impact.</p><p>These insights provide a foundational understanding of the layoffs landscape, offering useful perspectives on the industries, regions, and periods most affected by the layoffs.</p><p>Thank you for reading, I’ll appreciate your comments, feedback, or suggestions in the comment box.</p><blockquote>Follow me on <a href="http://www.linkedin.com/in/jesupelumi-afolayan">Linkedln</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9aac5763849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing A Layoff Data For Analysis— A Data Cleaning Journey Using SQL.]]></title>
            <link>https://medium.com/@jayphee/preparing-a-layoff-data-for-analysis-a-data-cleaning-journey-using-sql-01e869efecdb?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/01e869efecdb</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-cleaning]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 17:34:33 GMT</pubDate>
            <atom:updated>2024-08-30T17:34:33.888Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDoCtgMoTijXbq1P73PuFg.jpeg" /><figcaption>Image gotten from <a href="https://images.datacamp.com/image/upload/v1646566163/about_sql_5dcf267e9c.jpg">Google</a>.</figcaption></figure><p>It’s essential to clean data before analyzing it. I recently worked on a company layoff dataset, focusing solely on data cleaning. I tackled issues like missing values and inconsistent formatting using SQL to make the dataset usable.</p><p>In this post, I’ll share my steps to tidy up the data, turning a messy spreadsheet into something ready for meaningful analysis. If you’re into data, this quick walkthrough might be just what you need.</p><p>The dataset was obtained from the Kaggle website. You can access it <a href="https://www.kaggle.com/datasets/theakhilb/layoffs-data-2022">here</a>.</p><p>First off, I created a new schema named ‘layoffs_dataset’, and then imported the table into the MySQL workbench.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZpFlne7u4l6b3P1VL0OfBA.png" /></figure><p>Then, I used the ‘SELECT * FROM’ statement to view the table to know where and what to clean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*CsoyiQmd5RVnf3QdlvcjmQ.png" /></figure><p>The table contained 12 columns which include Company, Location_HQ, Industry, Laid_Off_Count, and Date amongst others</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hq5Qk5JWYVveXJJtMEQbEQ.png" /></figure><p><strong>CLEANING STEPS:</strong></p><p>I started by duplicating the original dataset using this syntax;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*Ce6dRetyff1kUdoRbtUk8w.png" /><figcaption>I created a new table called layoffs_data_staging just like the table ‘layoffs_data’ and inserted the data into it.</figcaption></figure><p>After the table had been successfully duplicated, the first step was to remove duplicates. To know which column had duplicates, I had to write these statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjioERjGTANgD1g4Ni5Yzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZmYzS0q0pmlRqJgUlFh6A.png" /><figcaption>In the end, there were no columns with duplicates because row_num &gt; 1 returned nothing</figcaption></figure><p>The next step was to standardize the data;<br>I used the trim function for some columns and updated it thereafter. There were two values of location(malmo and Dusseldorf) that were spelled wrongly. I cross-checked with the company column to see the correct name and then updated them using this query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AM2_t3NS1Dyfv9jQTPUR1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVfft3IjHoey00uN91pV_g.png" /></figure><p>Next, I changed the date column format from text to date using this query;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VU3qc_yiDBaT6L1gO_K2Jg.png" /></figure><p>Up next was to remove null and blanks, I used this query to confirm if there were null values or blanks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDEc6MWoiWDSHG__ap0huA.png" /><figcaption>In the end, there were no blanks nor NULL values.</figcaption></figure><p>The final step was to delete unimportant columns and this was done using this query and the source column was deleted because it won’t be needed for analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULQmdg2VSR2NOP9okfSFHw.png" /></figure><p>After all these steps, the data was cleaned and ready for analysis. Data Cleaning using SQL is quite technical but fun too!</p><p>Thanks for reading and following up till this stage. If you have any feedback or suggestions, you can leave them in the comment section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01e869efecdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Data Analysis Project — An HR Employee Attrition Analysis.]]></title>
            <link>https://medium.com/@jayphee/a-data-analysis-project-an-hr-employee-attrition-analysis-18e05251d041?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/18e05251d041</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[attrition-rate]]></category>
            <category><![CDATA[power-bi]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 13:46:03 GMT</pubDate>
            <atom:updated>2024-08-17T13:46:03.492Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Data Analysis Project — An HR Employee Attrition Analysis.</h3><p>Employee attrition is more than just a statistic — it represents real people making the difficult decision to leave their jobs. Whether it’s due to dissatisfaction, seeking new challenges, or personal reasons, each departure has a ripple effect on the company. It can impact team dynamics, disrupt projects, and increase recruitment and training costs.</p><p>This report explores the HR employee attrition dataset to better understand why employees choose to leave. By examining factors like job satisfaction, income, and work-life balance, I aim to uncover the underlying reasons behind these decisions. The goal is to provide insights that can help the organization create a more supportive and engaging workplace, where employees feel valued and motivated to stay and grow.</p><p><strong>DATA SOURCING</strong>: You can access the dataset which was obtained from Kaggle website <a href="https://www.kaggle.com/datasets/pavansubhasht/ibm-hr-analytics-attrition-dataset?resource=download">here</a>.</p><p><strong>DATA INFORMATION: </strong>The dataset contains information about 1,470 employees and includes 36 columns, such as:</p><ul><li><strong>Age</strong></li><li><strong>Attrition</strong> (whether an employee has left the company or not)</li><li><strong>BusinessTravel</strong></li><li><strong>Department</strong></li><li><strong>DistanceFromHome</strong></li><li><strong>Education</strong></li><li><strong>Gender</strong></li><li><strong>JobRole</strong></li><li><strong>MonthlyIncome</strong></li><li><strong>OverTime</strong></li><li><strong>YearsAtCompany</strong></li><li><strong>WorkLifeBalance</strong></li></ul><p><strong>Questions related to the data</strong></p><ol><li>What is the overall rate of employee attrition, and how does it vary between males and females?</li><li>How does attrition vary among different departments?</li><li>Which job roles are most affected by attrition?</li><li>How does work-life balance influence attrition? Are employees more likely to leave when their work-life balance is poor?</li><li>Which age group has the highest rate of attrition?</li></ol><p><strong>DATA CLEANING/ANALYSIS</strong></p><p>I loaded the dataset into Power BI and went to the table view to examine the data well. I went back to the report view and created a card for the total number of employees. I needed to create a card for the attrition employees so I went to power query to transform the data using conditional column as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSe1h-Laccr7edpr4y3HfQ.png" /><figcaption>The default column for Attrition was either yes or no. I needed a count hence the conditional column</figcaption></figure><p>To get the total number of employees, I used the COUNT function. Then, I created a new measure for the Attrition percentage using this formula;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*KRqbdwWFgfNla4laZC6H-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAE2G_1ngJqLIiEp1t7xsg.png" /></figure><p>I created a new column for the Distance from home bucket using the SWITCH function, but it wasn’t sorted properly so I created a sort column for it using the functions shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDNx-beb8kZ2imePvFtcjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sEVetzTt0RaO1PZU9YebA.png" /><figcaption>First Image: Grouped the distances for better visuals. Second Image: Created a sorting column to sort out the grouped distances</figcaption></figure><p>I applied this same method to Age Group. See below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*0NL68Q9KZ3QzYJVMx5oQug.png" /><figcaption>Age Grouping</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*78dWxXiXdRv0QlDW3Hfx1Q.png" /><figcaption>Age Group Sorting</figcaption></figure><p>I used this same function for the monthly income because there were numerous numeric values, so it needed grouping, but it didn’t need sorting, so there was no need for sorting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*ifqxKRVptxk18w6b65iqxQ.png" /></figure><p>The Job Satisfaction Level and Work Balance values were numerical so I needed to make the data ordinal (ranked). I achieved this by using conditional formatting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERMeGzIcM7BS9HTnXREJYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjcnwD5wcjyVcr5DWnKZXg.png" /></figure><p>DATA VISUALIZATION/INSIGHTS</p><p>After my cleaning and analysis, my report looked like this;</p><figure><img alt="Dash" src="https://cdn-images-1.medium.com/max/1024/1*hm97HEhB1jAtS-MpYdw4BA.png" /><figcaption>HR Attrition Dashboard built by Jesupelumi Afolayan</figcaption></figure><p>The total number of employees was 1470 of which 237 of them were Attritioned resulting in an attrition rate of 16.12%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*uHvknNpFxVIZHJDq7tY5Wg.png" /></figure><p>Out of the 237 Attrition employees, 150 were males while 87 were females.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*RQaKuEjO_ln1K0q6Gi2qeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*YrtZ5Dwfsy8euYZbzhvw8Q.png" /></figure><p>Laboratory Technicians experienced the most attrition, with 62 out of the 237 attrition employees being lab technicians, The department with the highest attrition employees is Research and Development contributing to 56.12% of the attrition employees. Employees with the shortest distance from home had the highest attrition with 87 (meaning distance wasn’t the issue). 127 out of 237 attrition employees worked overtime and the age group with the highest attrition was 26–39 years (youths and young adults).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*nafN2LVymja6iKrjY30n2Q.png" /></figure><p>200 of the attrition employees had low-performance rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*gixmCamS46t1gjZwyNizxw.png" /></figure><p>127 of the attrition employees were satisfied with their work-life balance while 25 of them felt their work-life balance was poor. 66 of them were very dissatisfied with their job, 73 were neutral, 46 were dissatisfied and 52 were satisfied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*5Y1Feaf2567gKGRt3GQBeA.png" /></figure><p>The Total sum of the monthly income of all employees was approximately $ 10 million while the total sum of the attrition employees&#39; monthly income was approximately $ 1 million meaning the company saved 10%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*4GTPu2T4XVqMeJmtb0jRFQ.png" /></figure><p><strong>CONCLUSION</strong></p><p>The HR employee attrition analysis revealed key factors influencing turnover. Younger employees and certain job roles show higher attrition rates, suggesting a need for targeted retention strategies. Lower salaries and poor work-life balance are linked to higher attrition, underscoring the importance of competitive pay and flexible work options.</p><p>Overtime work is another critical factor, with increased attrition among employees who work excessive hours, pointing to the need for better workload management. Additionally, differences in attrition between high and low performers highlight the role of performance in retention.</p><p>Addressing these areas — compensation, work-life balance, and job satisfaction — can help reduce attrition and build a more committed workforce.</p><p><strong>TOOLS USED</strong>: Microsoft Power BI</p><p>Thank you for Reading. Here is the Power BI report if you would like to view and interact with it. <a href="https://app.powerbi.com/view?r=eyJrIjoiMzA3MmQ4OTctMGU1NC00NTQwLWJkZTYtZjgyMzJhY2UzNmZmIiwidCI6IjhmNjViNGY5LWEyMjUtNDg0MC1hYTg4LTFmNzdkYTNjMTVlZCIsImMiOjh9"><em>Report</em></a><em>. </em>Please feel free to comment with your suggestions or feedback. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18e05251d041" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CUSTOMER OVERVIEW ANALYSIS & REPORT — Power BI]]></title>
            <link>https://medium.com/@jayphee/customer-overview-analysis-report-power-bi-89b66aa108fb?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/89b66aa108fb</guid>
            <category><![CDATA[customer-experience]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[power-bi]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Sat, 03 Aug 2024 05:14:17 GMT</pubDate>
            <atom:updated>2024-08-03T05:14:17.875Z</atom:updated>
            <content:encoded><![CDATA[<h3>CUSTOMER OVERVIEW ANALYSIS &amp; REPORT — Power BI</h3><p>In this data-driven world of ours, the key to success is understanding your customers. Tons of data are at our fingertips, but it is challenging to make meaning out of them and extract insights of value. This post guides you through my customer overview analysis and the supporting interactive report.</p><p>If you’re a data enthusiast, business professional, or just curious about customer analytics, join me as we explore the whole process from gathering and cleaning data to building a dashboard. Let’s dive into customer insights and discover how data can lend a hand.</p><p><strong>DATA SOURCING</strong>: This dataset was obtained from the Kaggle website. You can access the dataset <a href="https://www.kaggle.com/datasets/kaushiksuresh147/customer-segmentation/data">here</a>.</p><p><strong>DATA INFORMATION: </strong>The dataset has 2628 rows and 11 columns comprising Customer ID, Gender, Age, Graduated, Ever Married, Profession, and Work Experience amongst others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBqrRsHekpYFD2kSFGjjEA.png" /><figcaption>How the dataset looked after loading it into Excel</figcaption></figure><p><strong>OBJECTIVES:</strong><br>Some of the customer questions related to our data<br>1. What is the total number of customers?<br>2. What is the percentage of male-to-female customers?<br>3. What profession has the highest number of customers?<br>4. What is the total number of customers by age?<br>5. How does work experience affect spending score?</p><p><strong>DATA CLEANING: </strong>I imported the CSV file into Excel for basic cleaning. I cleared out the blanks for the categorical data but for the numerical data, I used the mean to fill up the blanks.</p><p>I was now left with 2488 rows and then I loaded it into Power BI for analysis and visualization.</p><p><strong>DATA ANALYSIS/PROCESSING: </strong>I created a new measure for number of customers by using the ‘<em>DISTINCT COUNT</em>’ function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QVqPjF03mCtabOCOjVeNw.png" /><figcaption>This was done to get a measure solely for the number of customers.</figcaption></figure><p>I also created a new measure called ‘Age Buckets’ and applied some logic functions to it. Since the age column was an interval, I needed to make it categorical hence the application of the logic function “<em>Switch ( True())</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0_ersRoBkr4lD9GYJUqIw.png" /></figure><blockquote>The implication of the DAX function here was that if the age is greater than 0 and less than or equal to 39 years, it should be categorized as ‘Young Adults’, if greater than or equal to 40 and less than or equal to 59 years, it should be categorized as ‘Middle-age Adults’ and finally if less than or equal to 60 and greater than or equal to 99 years, it should be categorized as ‘Old Adults’.</blockquote><p>The work experience column was ranked from 0–15 in which the highest was 13 and lowest 0. I decided to break it down into 3 categories such as 0–4 categorized as ‘<em>Junior</em>’, 5–9 categorized as ‘<em>Mid-level</em>’, and 10–15 categorized as ‘<em>Senior</em>’. I achieved this by using the same logic DAX function I used for the age buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4UMh8mJ1UqoxjkGn_HqziA.png" /></figure><p>I then applied the category and profession columns as filters</p><p><strong>DATA VISUALIZATION/INSIGHTS: </strong>After analyzing, my visualization looked like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twmpvZwbj825i43yopUDMQ.png" /><figcaption>Customer Overview Report</figcaption></figure><blockquote>Now, looking at the report we can answer the customer-related questions cited earlier.</blockquote><p>The total number of customers is 2488. The percentage of male-to-female customers is 54.3%(1352) to 45.7%(1136) which is almost equally distributed. 1542 customers have graduated which means 38%(946) didn’t graduate or have not graduated. 58.9% of the customers were ever married while 1023(41.1%) haven’t married.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVYbYEo11LmnNdb50IU_HA.png" /></figure><p>1,159 customers were within the age range of 0–39, while 872 customers were within the ages 40–59 and 457 customers were considered as Old Adults.</p><p>Although Young Adults accounted for the largest portion of customers, they didn’t spend as much as the Old Adults. Only 50 of the Young Adults had a spending score of high, 161 spent average and 942 spent low.</p><p>The artistry profession is responsible for the highest number of customers, which is followed by healthcare and entertainment down to homemakers as seen in the visuals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fatELR2ClyrTvKKO1K4rXQ.png" /></figure><p><strong>TOOLS USED: </strong>Microsoft Excel for cleaning and Power BI for analysis and visualization.</p><p>Thank you for Reading. Here is the Power BI report if you would like to view and interact with it. <a href="https://app.powerbi.com/view?r=eyJrIjoiODllZjVhYTctNmNjZS00MjliLTg2M2QtNTY0MjBmMjRkNWVmIiwidCI6IjhmNjViNGY5LWEyMjUtNDg0MC1hYTg4LTFmNzdkYTNjMTVlZCIsImMiOjh9"><em>Report</em></a><em>. </em>Please feel free to comment with your suggestions or feedback. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89b66aa108fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SALES ANALYSIS — Excel]]></title>
            <link>https://medium.com/@jayphee/sales-analysis-excel-3884a0de4be4?source=rss-75439806c059------2</link>
            <guid isPermaLink="false">https://medium.com/p/3884a0de4be4</guid>
            <category><![CDATA[sales-dashboard]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Jesupelumi Afolayan]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 17:09:47 GMT</pubDate>
            <atom:updated>2024-04-07T17:11:34.434Z</atom:updated>
            <content:encoded><![CDATA[<h3>SALES ANALYSIS — Excel</h3><p>This is an analysis of a sales dataset to uncover insights</p><p><strong>DATA SOURCING:</strong> This Dataset was gotten from Kaggle website</p><p><strong>OBJECTIVES:</strong><br>Some of the business questions related to our data<br>1. What was the total Sales, profit, COGS and units sold?<br>2. What was the highest selling product and by how much?<br>3. What was the most profitable country?<br>4. What was the highest and lowest selling segment?<br>5. What was the total sales by product, segment, country and year?</p><p><strong>DATA INFORMATION</strong><br>The dataset is a sales dataset that contains 2412 rows and 15 columns comprising segment, country, product, gross sales, profit, COGS, year<br>amongst others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaSAwFAFihHHDsQLDHEavA.png" /></figure><p><strong>DATA CLEANING:</strong><br>Firstly, I deleted the visible blank rows manually, then I removed duplicate values by highlighting the whole data and clicking remove duplicates option in the data tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3fYqfwnw5mwyfybx9VKJQ.png" /></figure><p>I then changed the format of some sales column from general to accounting. Then converted the text format of the date column to its proper format. Then converted the data to Tables using Ctrl + T and filtered out the hidden blank rows. Afterwards my dataset looked like this;</p><figure><img alt="A fully cleaned data" src="https://cdn-images-1.medium.com/max/1024/1*x3IEO6JI44YCuukqeLCo7A.png" /></figure><p><strong>DATA ANALYSIS:</strong><br>I created 4 pivot tables;<br>1. with the country in columns, the sum of profit and sum of gross sales in values and year as filter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aimSgAVYrKyjOMmIvwB6xQ.png" /></figure><p>2. with the segment in columns, the sum of gross sales in values and year as filter<br>3. with the product in columns, the sum of gross sales in values and year as filter<br>4. with the year in columns and sum of gross sales in values.</p><p>I inserted a timeline of year and connected all pivot tables except from the 4th one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHHr8Kme773H0gRCIuxvjA.png" /></figure><p>I extracted the pivot table data of product, country, segment and year with their corresponding total sales and profit. I then did a calculation of Total sales, total profit, total COGS and total units sold in general using the sum() function.<br>I then analyzed and calculated the highest selling product, highest selling country and segment and highest profitable country.<br>At the end my data analysis sheet looked like this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZQbvl9vF2xp4yNaO4jBuQ.png" /></figure><p><strong>DATA VISUALIZATION/INSIGHTS</strong><br>Total sales was <em>$235,826,936</em>, Total profit was <em>$87,124,311</em> which was 80% profit, Total COGS was <em>$128,807,365</em> and <em>1,539,302 </em>units were sold in total.</p><p>Paseo was the highest selling product which accounted for 30% of the total sales while Montana was the lowest selling product.</p><p>The Government segment made more sales than any other segment while channel partners made the lowest sales.</p><p>The highest profitable country was Mexico, they made a profit of <em>$20,888,973</em> from their total COGS which was <em>$24,371,349</em> and that is a 86% profit which is huge. Also they accounted for 24% of the total profit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WEihLOOV2RIh3x8ovZFsQ.png" /></figure><p>China had no record of COGS, sales and profit in 2016 and 2017.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*j4VqdZra1PH-f3bhKMUh1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*bFQxdW6514ufMnzBQvVzJQ.png" /><figcaption>No Sales and Profit made for China in 2016 and 2017</figcaption></figure><p>Total sales increased in 2017, reduced in 2018 and increased back in 2019 (<em>$99,367,281</em>) which was the highest selling year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*9VfZ77RJ8tWqV5Mqv12r8A.png" /></figure><p><strong>TOOLS USED:</strong> Microsoft Excel from start to finish.</p><p>Thanks for Reading.<br>Please feel free to comment your suggestion or feedback.<br>I look forward to sharing more insights in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3884a0de4be4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>