<?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 Toheeb Ogunmola on Medium]]></title>
        <description><![CDATA[Stories by Toheeb Ogunmola on Medium]]></description>
        <link>https://medium.com/@BZubair20?source=rss-718799778e33------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tOll4QzzyKLu7aa2</url>
            <title>Stories by Toheeb Ogunmola on Medium</title>
            <link>https://medium.com/@BZubair20?source=rss-718799778e33------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:15:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@BZubair20/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[Sales Analysis Using Excel]]></title>
            <link>https://medium.com/@BZubair20/sales-analysis-using-excel-7cbb00a33694?source=rss-718799778e33------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cbb00a33694</guid>
            <category><![CDATA[data-transformation]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sales-analysis]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Toheeb Ogunmola]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 14:01:25 GMT</pubDate>
            <atom:updated>2024-09-15T14:01:25.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*orlYeM8-6uunimSXE_eI8w.jpeg" /></figure><p><strong>Project Title</strong>: Sales Analysis</p><p><strong>Introduction</strong>: This Analysis focusses on the sales of products in a store with different branches.</p><p><strong>Objectives:</strong></p><ol><li>What is the revenue by product line?</li><li>How are the products ordered?</li><li>Revenue by Payment type</li><li>Revenue by gender</li><li>Revenue by month</li><li>Sales by time of day</li><li>Which branch has the most sales?</li></ol><p>The dataset was loaded into Excel for analysis and visualization</p><p>The data was cleaned and transformed for proper analysis using the Excel functions.</p><p><strong>Data Transformation</strong></p><p>I used the <strong>IF </strong>function to change the customer type from 0 and 1 to members and non-members</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*N4hBq54wHdoIhjaWifahwA.png" /></figure><p>Afterwards, I modified the gender column labels from ‘FM’ and ‘M’ to ‘Female’ and ‘Male’ respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*EcCB6cTA6kFDRfxgM8TyYA.png" /></figure><p>In order to get the time of day, I used the <strong>HOUR</strong> function to extract the hour of each row from the time column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/1*t9wB57uCefj3qTQdHpYbBQ.png" /></figure><p>then I used the <strong>IFS</strong> function to create the time-of-day column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*tXuxOgiZ2f-gE0TkgoNkUQ.png" /></figure><p>Then next step is creating the necessary measures needed for analysis, which was done with the Measures feature in the Power Pivot Tab of the Excel workbook</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ms2K22YnFRikyqAAQEeK3g.png" /></figure><p>After creating the measures, then creating the PIVOT TABLE for the analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3z7eAZqBCzGQx6CBHiINUw.png" /></figure><p><strong>Analysis and Visualization</strong></p><p>The <strong>Food and Beverage</strong> product line has the highest sales, totaling $56,145, closely followed by the <strong>Sports and Travel </strong>line at $55,123. Meanwhile, the Health and Beauty line has the lowest sales, amounting to $49,194.</p><p><strong>Electronics and Accessories</strong> lead in sales with a total of 971 orders, followed closely by <strong>Food and Beverages</strong> with 952 orders, while <strong>Health and Beauty</strong> have the lowest with 854 orders.</p><p><strong>E-Wallets </strong>are the leading payment method, used 345 times, closely followed by <strong>Cash</strong> at 344 uses, and <strong>Credit cards</strong> at 311 uses.</p><p><strong>Females</strong> account for 50.10% of the transactions at the store, while <strong>Males</strong> make up 49.90%. Additionally, <strong>Females </strong>tend to spend more on purchases, with a total expenditure of $167,883 compared to <strong>Males</strong>, who spend $155,084.</p><p><strong>January</strong> recorded the highest sales figures, totaling $116,292, followed by <strong>March</strong> with sales of $109,456, and <strong>February</strong> with the lowest, at $97,219.</p><p>The majority of sales occur in the <strong>afternoon</strong>, with a total of 439 transactions, followed by the <strong>night</strong> with 281 transactions, and closely followed by the <strong>morning </strong>with 280 transactions.</p><p><strong>Branch C</strong> leads in sales with a total of $110,569, followed by <strong>Branch A</strong> with $106,200, while <strong>Branch B</strong> has the lowest sales at $106,198.</p><p>The best-selling product across all stores is <strong>Food and Beverages</strong>; however, this varies by branch. In Branch A, <strong>Home and Lifestyle</strong> products are the top sellers, while in Branch B, <strong>sports and Travel</strong> items lead sales. In Branch C, <strong>Food and Beverages</strong> remain the most purchased products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLmdcfZo33Qv8tJbrFkSHg.png" /></figure><p><strong>Recommendations</strong></p><p>Based on the analysis of sales data, here are some recommendations to optimize performance and address areas of improvement:</p><ol><li>Focus on High-Performing Product Lines:</li></ol><ul><li>Food and Beverage and Sports and Travel lines are performing exceptionally well. Consider expanding the range of products in these categories or introducing premium options to capitalize on their popularity. Health and Beauty products have the lowest sales. Investigate potential reasons, such as product variety, pricing, or marketing strategies, and implement targeted promotions or product improvements to boost sales.</li><li><strong>E-Wallets</strong> and <strong>cash</strong> are the most preferred payment methods. Ensure these options are prominently available and consider offering incentives for using these methods to maintain customer satisfaction. Although <strong>credit cards</strong> are less frequently used, they still represent a significant portion of transactions. Offering promotions or loyalty points for credit card users could encourage more frequent use.</li></ul><p>2. Enhance Payment Methos Options:</p><ul><li>Since <strong>females</strong> account for a slightly higher percentage of transactions and spend more overall, tailor marketing campaigns to appeal to female customers. Highlight products and promotions that align with their preferences.</li></ul><p>3. Seasonal and Time-Based Promotions:</p><ul><li><strong>January</strong> and <strong>March</strong> have the highest sales figures. Plan major promotions or product launches during these months to maximize revenue.</li><li>Since the majority of sales occur in the <strong>afternoon</strong>, consider running time-limited promotions or discounts during this period to further boost sales.</li></ul><p>4. Branch-Specific Strategies:</p><ul><li><strong>Branch C</strong> leads in sales, indicating effective strategies that could be replicated in other branches. Analyze what Branch C is doing well and implement similar practices in Branches A and B. Address the slight underperformance of <strong>Branch B</strong> by identifying specific challenges it faces and providing targeted support or resources to improve its sales.</li></ul><p>5. Product Line Optimization by Branch:</p><ul><li>Tailor product offerings to the preferences of each branch. For example, ensure <strong>Home and Lifestyle</strong> products are well-stocked in Branch A, <strong>Sports and Travel</strong> items in Branch B, and <strong>Food and Beverages</strong> in Branch C. Regularly review sales data to adjust inventory and promotions based on changing customer preferences and trends.</li></ul><p>You can follow me on Twitter <a href="https://twitter.com/BZubair20">Gbolahannnnnnnn (@BZubair20) / X (twitter.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cbb00a33694" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customer Segmentation and RFM Analysis Using MySQL]]></title>
            <link>https://medium.com/@BZubair20/customer-segmentation-and-rfm-analysis-using-mysql-eefb293e6863?source=rss-718799778e33------2</link>
            <guid isPermaLink="false">https://medium.com/p/eefb293e6863</guid>
            <category><![CDATA[rfm-analysis]]></category>
            <category><![CDATA[mysql-workbench]]></category>
            <category><![CDATA[critical-thinking]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[customer-segmentation]]></category>
            <dc:creator><![CDATA[Toheeb Ogunmola]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 16:27:59 GMT</pubDate>
            <atom:updated>2024-07-16T16:27:59.302Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYxZW8kppOzxYo1jSGQaQA.jpeg" /></figure><p>Project Title: Customer Segmentation and RFM Analysis</p><p>Date: July 16, 2024</p><p><strong>Introduction</strong>: <strong>RFM analysis</strong> is a data-driven customer segmentation technique that helps marketers understand and categorize customers based on three key factors:</p><ol><li><strong>Recency:</strong> How recently has a customer made a purchase.</li><li><strong>Frequency (F)</strong>: How often they make purchases.</li><li><strong>Monetary value (M)</strong>: How much they spend.</li></ol><p>By analyzing these metrics, businesses can segment their customer base into homogeneous groups and tailor personalized marketing strategies. RFM empowers marketers to identify valuable customers, reduce churn, and engage effectively with different customer segments.</p><p><strong>Exploring the Data</strong></p><pre>SELECT *<br> FROM toheebdb.customer_segmentation;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIOiyhj58XDv1aNeAUwP9A.png" /></figure><p>I have to check for the necessary columns needed for RFM analysis</p><p><strong>Recency</strong></p><pre><br>           SELECT  recency,id, <br>                   Education,<br>                   Marital_Status<br>           from customer_segmentation<br>            group by id<br>            ORDER BY Recency ASC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*JEqGRpZFuuT-IoyGkwzKCg.png" /></figure><p>The Recency column is available in the table next I checked for the Frequency column.</p><p><strong>Frequency</strong></p><p>In order to arrive at the frequency, I have to add up number of purchases made through different channels which are: (<strong>NumWebPurchases</strong>, <strong>NumDealsPurchases</strong>, <strong>NumCatalogPurchases</strong>, <strong>NumStorePurchases</strong>)</p><pre> SELECT SUM(NumCatalogPurchases+<br>                       NumDealsPurchases+<br>                       NumStorePurchases+<br>                       NumWebPurchases) AS frequency,<br>                   id,<br>                   Education,<br>                   Marital_Status<br>             FROM customer_segmentation<br>            GROUP BY id<br>            ORDER BY frequency DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*GqsLEvGV74eLLmFxnVeYUA.png" /></figure><p>The next step is to calculate for the Monetary column which is the total amount each customers spent.</p><p><strong>Monetary</strong></p><p>To calculate for monetary, I have to add up the amount each customer spent on the products namely: (<strong>MntWines</strong>, <strong>MntFruits</strong>, <strong>MntMeatProducts</strong>, <strong>MntFishProducts</strong>, <strong>MntSweetProducts</strong>, <strong>MntGoldProds</strong>)</p><pre>SELECT SUM(mntwines+<br>   MntFruits+<br>            MntFishProducts+<br>            MntGoldProds+<br>            MntMeatProducts+<br>            MntSweetProducts) AS Monetary,<br>        id,<br>        Education,<br>        marital_status<br> FROM customer_segmentation<br> GROUP BY id<br> order by monetary DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*W8HmX_OYdeLbMdlYqf1DPQ.png" /></figure><p>After calculating for Recency, Frequency and Monetary, we move to the next item by making CTE to use calculate the RFM analysis then we use the N-Tile function to rank Recency, Frequency and Monetary in the appropriate orders.</p><pre>WITH rfm AS (SELECT id,  <br>                                 education, <br>                                  income, <br>                                 Marital_Status, <br>                                recency, <br>                               SUM(NumCatalogPurchases+<br>                                   NumDealsPurchases+<br>                                                        NumStorePurchases+<br>                                                        NumWebPurchases) AS Frequency,<br>                                                    SUM(mntwines+<br>              MntFruits+<br>                                                        MntFishProducts+<br>                                                        MntGoldProds+<br>                                                        MntMeatProducts+<br>                                                        MntSweetProducts) AS Monetary<br>                                     FROM customer_segmentation<br>                                      GROUP BY id, education<br>                    ORDER BY recency<br>                            )<br>                             SELECT *,<br>             NTILE(5) OVER (ORDER BY recency DESC) rfm_recency,<br>             NTILE(5) OVER (ORDER BY Frequency ASC) rfm_frequency,<br>                   NTILE(5) OVER (ORDER BY monetary ASC) rfm_monetary<br>                               FROM rfm </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*QV82I91aT7sQGblj90zwiw.png" /></figure><p>I will proceed to calculate the total RFM score and code for proper segmentation.</p><pre>WITH rfm AS (SELECT id,  <br>                                       education, <br>                                                    income, <br>                                     Marital_Status, <br>                                      recency, <br>                                     SUM(NumCatalogPurchases+<br>                                                        NumDealsPurchases+<br>                                                        NumStorePurchases+<br>                                                        NumWebPurchases) AS Frequency,<br>                                                    SUM(mntwines+<br>              MntFruits+<br>                                                        MntFishProducts+<br>                                                        MntGoldProds+<br>                                                        MntMeatProducts+<br>                                                        MntSweetProducts) AS Monetary<br>                                     FROM customer_segmentation<br>                                      GROUP BY id, education<br>                    ORDER BY recency<br>                            ), <br>                            rfm_calc AS(<br>                               SELECT *,<br>             NTILE(5) OVER (ORDER BY recency DESC) rfm_recency,<br>             NTILE(5) OVER (ORDER BY frequency ASC) rfm_frequency,<br>                   NTILE(5) OVER (ORDER BY monetary ASC) rfm_monetary<br>                               FROM rfm <br>                                ORDER BY rfm_monetary DESC<br>                                )<br>                                SELECT *, rfm_recency + rfm_frequency + rfm_monetary AS rfm_score,<br>                                CONCAT(rfm_recency, rfm_frequency, rfm_monetary) AS rfm <br>                                                  FROM rfm_calc AS c ;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*LL-gQHrs8E1BcJqYXw0Seg.png" /></figure><p>Now the next step is to group the customer segments into 11 groups:</p><ol><li><strong>Champions</strong>: Bought recently, buy often and spend the most.</li><li><strong>Loyal</strong>: Spend good money, Responsive to promotions.</li><li><strong>Potential Loyalists</strong>: Recent customers, spent good amount, bought more than once.</li><li><strong>New Customers</strong>: Bought more recently</li><li><strong>Promising</strong>: Customers with moderate recency, frequency, and monetary value.</li><li><strong>Need Attention</strong>: Customers who require attention due to declining engagement.</li><li><strong>About to Sleep</strong>: Customers at risk of becoming inactive.</li><li><strong>At Risk</strong>: Spent big money, purchased often but a long time ago</li><li><strong>Cannot Lose</strong>: Made big purchases and often but long time ago</li><li><strong>Hibernating Customers</strong>: Inactive customers who were once engaged.</li><li><strong>Lost Customers</strong>: Lowest recency, frequency and monetary values</li></ol><pre> SELECT <br>        *,<br>          CASE WHEN RFM IN (555,554,544,545,454,455,445) then &quot;champions&quot;<br>                                WHEN rfm IN (543,444,435,355,345,344,335,354) THEN &quot;loyal&quot;<br>                                WHEN rfm IN (553,551,552,541,542,533,532,531,452,451,442,441,431,453,433,432,423,353,352,351,342,341,333,323) THEN &quot;potential loyalist&quot;<br>                                WHEN rfm IN (512,511,422,421,412,411,311) THEN &quot;new customers&quot;<br>                 WHEN rfm IN (525,524,523,522,521,515,514,513,425,424,413,414,415,315,314,313) THEN &quot;promising&quot; <br>                                WHEN rfm IN (535,534,443,434,343,334,325,324) THEN &quot;need attention&quot;<br>                                WHEN rfm IN (331,321,312,221,213,231,241,251) THEN &quot;about to sleep&quot;<br>                                WHEN rfm IN (255,254,245,244,253,252,243,242,235,234,225,224,153,152,145,143,142,135,134,133,125,124) THEN &quot;at risk&quot;<br>                                WHEN rfm IN (155,144,214,215,115,114,113,154) THEN &quot;cannot lose them&quot;<br>                                WHEN rfm IN (332,322,231,241,251,233,232,223,222,132,123,122,212,211) THEN &quot;hibernating customers&quot;<br>                                WHEN rfm IN (111,112,121,131,141,151) THEN &quot;lost customers&quot;<br>                                END AS rfm_segment<br>                                FROM(<br>                                  WITH rfm AS (SELECT id,  <br>                                       education, <br>                                                    income, <br>                                     Marital_Status, <br>                                      recency, <br>                                     SUM(NumCatalogPurchases+<br>                                                        NumDealsPurchases+<br>                                                        NumStorePurchases+<br>                                                        NumWebPurchases) AS Frequency,<br>                                                    SUM(mntwines+<br>              MntFruits+<br>                                                        MntFishProducts+<br>                                                        MntGoldProds+<br>                                                        MntMeatProducts+<br>                                                        MntSweetProducts) AS Monetary<br>                                     FROM customer_segmentation<br>                                      GROUP BY id, education<br>                    ORDER BY recency<br>                            ), <br>                            rfm_calc AS(<br>                               SELECT *,<br>             NTILE(5) OVER (ORDER BY recency DESC) rfm_recency,<br>             NTILE(5) OVER (ORDER BY frequency ASC) rfm_frequency,<br>                   NTILE(5) OVER (ORDER BY monetary ASC) rfm_monetary<br>                               FROM rfm <br>                                ORDER BY rfm_monetary DESC<br>                                )<br>                                SELECT *, rfm_recency + rfm_frequency + rfm_monetary AS rfm_score,<br>                                CONCAT(rfm_recency, rfm_frequency, rfm_monetary) AS rfm <br>                                                  FROM rfm_calc) AS c;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*urHA5bbiBQ2w5RrBOifgLQ.png" /></figure><p>After grouping the customers into their segments, i used the query to create a RFM Analysis table.</p><pre>CREATE TABLE  rfm_analysis AS                                              <br>      SELECT <br>        *,<br>          CASE WHEN RFM IN (555,554,544,545,454,455,445) then &quot;champions&quot;<br>                                WHEN rfm IN (543,444,435,355,345,344,335,354) THEN &quot;loyal&quot;<br>                                WHEN rfm IN (553,551,552,541,542,533,532,531,452,451,442,441,431,453,433,432,423,353,352,351,342,341,333,323) THEN &quot;potential loyalist&quot;<br>                                WHEN rfm IN (512,511,422,421,412,411,311) THEN &quot;new customers&quot;<br>                 WHEN rfm IN (525,524,523,522,521,515,514,513,425,424,413,414,415,315,314,313) THEN &quot;promising&quot; <br>                                WHEN rfm IN (535,534,443,434,343,334,325,324) THEN &quot;need attention&quot;<br>                                WHEN rfm IN (331,321,312,221,213,231,241,251) THEN &quot;about to sleep&quot;<br>                                WHEN rfm IN (255,254,245,244,253,252,243,242,235,234,225,224,153,152,145,143,142,135,134,133,125,124) THEN &quot;at risk&quot;<br>                                WHEN rfm IN (155,144,214,215,115,114,113,154) THEN &quot;cannot lose them&quot;<br>                                WHEN rfm IN (332,322,231,241,251,233,232,223,222,132,123,122,212,211) THEN &quot;hibernating customers&quot;<br>                                WHEN rfm IN (111,112,121,131,141,151) THEN &quot;lost customers&quot;<br>                                END AS rfm_segment<br>                                FROM(<br>                                  WITH rfm AS (SELECT id,  <br>                                       education, <br>                                                    income, <br>                                     Marital_Status, <br>                                      recency, <br>                                     SUM(NumCatalogPurchases+<br>                                                        NumDealsPurchases+<br>                                                        NumStorePurchases+<br>                                                        NumWebPurchases) AS Frequency,<br>                                                    SUM(mntwines+<br>              MntFruits+<br>                                                        MntFishProducts+<br>                                                        MntGoldProds+<br>                                                        MntMeatProducts+<br>                                                        MntSweetProducts) AS Monetary<br>                                     FROM customer_segmentation<br>                                      GROUP BY id, education<br>                    ORDER BY recency<br>                            ), <br>                            rfm_calc AS(<br>                               SELECT *,<br>             NTILE(5) OVER (ORDER BY recency DESC) rfm_recency,<br>             NTILE(5) OVER (ORDER BY frequency ASC) rfm_frequency,<br>                   NTILE(5) OVER (ORDER BY monetary ASC) rfm_monetary<br>                               FROM rfm <br>                                ORDER BY rfm_monetary DESC<br>                                )<br>                                SELECT *, rfm_recency + rfm_frequency + rfm_monetary AS rfm_score,<br>                                CONCAT(rfm_recency, rfm_frequency, rfm_monetary) AS rfm <br>                                                  FROM rfm_calc) AS c;</pre><p>I ran the code to show the rfm_analysis table</p><pre>  SELECT * <br>  FROM rfm_analysis;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFQwTTp6fmU5AdiXTqXqTA.png" /></figure><p>The next step is to run the analysis on the rfm table created to show the segment with most customers and the segment that has spent more money.</p><p><strong>Highest Spenders</strong></p><pre>WITH C AS (<br>    SELECT SUM(Monetary) AS amount_spent<br>              , rfm_segment<br>    FROM rfm_analysis<br>    GROUP BY rfm_segment<br>)<br>SELECT rfm_segment, amount_spent,<br>       (ROUND(SUM(amount_spent) * 100.0 / SUM(amount_spent) OVER (),2)) AS percentage<br>FROM c<br>GROUP BY rfm_segment<br>ORDER BY percentage DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*QHsCssDZxKwoLL3XFyOvaA.png" /></figure><p><strong>At risk</strong> customer segment are the highest spender at 28.40%, followed by <strong>Champions</strong> at 24.68%, and <strong>about to sleep </strong>at 0.20%.</p><p><strong>Segment with Most Customers</strong></p><p>Now we run a query to show the customer segment with highest number of customers.</p><pre>WITH c AS (<br>    SELECT COUNT(*) AS no_of_customers, rfm_segment<br>    FROM rfm_analysis<br>    GROUP BY rfm_segment<br>)<br>SELECT rfm_segment, no_of_customers,<br>      ROUND((SUM(no_of_customers) * 100.0) / SUM(no_of_customers) OVER(),2 )AS percentage<br>FROM c<br>GROUP BY rfm_segment<br>order by percentage DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*fGUVaSatolkKKZr7mb2oLA.png" /></figure><p>majority of the customer base is <strong>At Risk </strong>customers at 16.70%, followed by <strong>hibernating</strong> customers at 15.21%.</p><p>What to do with the customers:</p><p><strong>Champions:</strong></p><ul><li><strong>Reward Loyalty:</strong> Continue to engage and reward these customers. Offer exclusive discounts, early access to new products, or loyalty points.</li><li><strong>Upsell and Cross-Sell:</strong> Recommend complementary products based on their past purchases.</li><li><strong>Personalize Communications:</strong> Send personalized emails or messages to maintain their interest.</li></ul><p><strong>Loyal Customers:</strong></p><ul><li><strong>Maintain Engagement:</strong> Keep them engaged with regular updates, personalized offers, and relevant content.</li><li><strong>Ask for referrals:</strong> Encourage them to refer friends and family.</li><li><strong>Feedback Loop:</strong> Seek feedback to improve their experience.</li></ul><p><strong>Potential Loyalists:</strong></p><ul><li><strong>Nurture Relationships:</strong> Provide exceptional service to convert them into loyal customers.</li><li><strong>Segmentation:</strong> Understand their preferences and tailor marketing efforts accordingly.</li><li><strong>Promotions:</strong> Offer incentives to encourage repeat purchases.</li></ul><p><strong>New Customers:</strong></p><ul><li><strong>Welcome Campaign:</strong> Send a warm welcome email with an introductory offer.</li><li><strong>Onboarding:</strong> Guide them through your products/services.</li><li><strong>Educate:</strong> Share relevant content to help them make the most of their purchase.</li></ul><p><strong>Promising Customers:</strong></p><ul><li><strong>Segmentation:</strong> Understand their behavior (e.g., browsing history, cart abandonment).</li><li><strong>Targeted Offers:</strong> Send personalized promotions based on their interests.</li><li><strong>Engagement:</strong> Keep them interested through relevant content.</li></ul><p><strong>Need Attention:</strong></p><ul><li><strong>Win-Back Campaigns:</strong> Reach out to inactive customers with special offers.</li><li><strong>Feedback:</strong> Understand why they’ve disengaged and address any issues.</li><li><strong>Re-Engagement Tactics:</strong> Use retargeting ads or personalized emails.</li></ul><p><strong>About to Sleep:</strong></p><ul><li><strong>Timely Reminders:</strong> Send reminders about their last purchase.</li><li><strong>Exclusive Offers:</strong> Encourage them to stay active with limited-time discounts.</li><li><strong>Personal Touch:</strong> Reach out personally to rekindle their interest.</li></ul><p><strong>At Risk</strong></p><ul><li><strong>Proactive Outreach:</strong> Identify reasons for potential churn (e.g., declining purchases).</li><li><strong>Retention Campaigns:</strong> Offer personalized incentives to prevent them from leaving.</li><li><strong>Customer Support:</strong> Address any issues promptly.</li></ul><p><strong>Cannot Lose Them</strong></p><ul><li><strong>VIP Treatment:</strong> Treat them like valued partners.</li><li><strong>Custom Solutions:</strong> Tailor offerings to their specific needs.</li><li><strong>Relationship Building:</strong> Regular check-ins and personalized interactions.</li></ul><p><strong>Hibernating Customers</strong></p><ul><li><strong>Reactivation Campaigns:</strong> Send targeted emails with enticing offers.</li><li><strong>Product Recommendations:</strong> Suggest relevant products based on their history.</li><li><strong>Win Back Their Interest:</strong> Highlight any updates or improvements.</li></ul><p><strong>Lost Customers:</strong></p><ul><li><strong>Learn from Churn:</strong> Analyze why they left and learn from it.</li><li><strong>Feedback Loop:</strong> If possible, seek feedback to improve.</li><li><strong>Win-Back Efforts:</strong> Occasionally try to re-engage them with special offers.</li></ul><p><strong>CONCLUSION</strong></p><ul><li>The majority of the customer base falls into the “At Risk” and “Hibernating” segments. Focus on retaining and re-engaging these customers.</li><li>Monitor customer behavior closely, track changes in spending patterns, and adjust your strategies accordingly.</li><li>Use data-driven insights to tailor marketing efforts, improve customer experiences, and maximize customer lifetime value.</li></ul><p>Follow me on X <a href="https://twitter.com/BZubair20">Gbolahannnnnnnn (@BZubair20) / X (twitter.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eefb293e6863" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multinational Supply Chain Analysis using MySQL]]></title>
            <link>https://medium.com/@BZubair20/multinational-supply-chain-analysis-using-sql-9058ff16bd3d?source=rss-718799778e33------2</link>
            <guid isPermaLink="false">https://medium.com/p/9058ff16bd3d</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[critical-thinking]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[supply-chain-analytics]]></category>
            <dc:creator><![CDATA[Toheeb Ogunmola]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 20:26:03 GMT</pubDate>
            <atom:updated>2024-07-15T20:46:22.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A1OyLILNjRaWa3SnTPHrdw.png" /></figure><p><strong>Project Title: </strong>Multinational Supply Chain Analysis</p><p><strong>Date:</strong> July 15, 2024</p><p>Introduction: A <strong>multinational supply chain</strong> refers to the interconnected network that spans across multiple countries, enabling the efficient flow of goods and services from suppliers to consumers. For multinational corporations (MNCs), effective supply chain management is crucial. It ensures timely production, distribution, and delivery of products while maximizing profits. The data presents the orders, shipping, sales, and profit of products in a multinational supply chain store.</p><h4>Exploring the Data</h4><pre>SELECT * <br>FROM toheebdb.datacosupplychaindataset;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTEPOFXoDftPmHfYhHSHMA.png" /></figure><p><strong>Objectives</strong></p><p>1. Sales, Orders, and Profitability Analysis: This involves analyzing the volume and frequency of orders and sales, as well as the diversity of products purchased.</p><p>2. Geographical analysis: determining which region places the most orders and assessing the effectiveness of product distribution.</p><p>3. Shipping Analysis: Evaluating the supply chain’s performance in fulfilling orders within the agreed time, including delivery speed and reliability.</p><p><strong>Data cleaning</strong></p><p>I cleaned the data before analysis by taking the following steps:</p><pre># Converting order date column from string to date format <br>UPDATE datacosupplychaindataset<br>SET order_date = STR_TO_DATE(order_date, &#39;%m/%d/%Y&#39; );<br><br><br># Converting the shipping date column from string to date format<br>UPDATE datacosupplychaindataset<br>SET shipping_date = STR_TO_DATE(shipping_date, &#39;%m/%d/%Y&#39; ); <br><br><br># Replacing EE.UU to USA <br>UPDATE datacosupplychaindataset<br>SET Customer_Country = REPLACE(customer_country, &quot;EE. UU.&quot;, &quot;USA&quot;);<br><br><br>ALTER TABLE datacosupplychaindataset<br>RENAME COLUMN `Days_for_shipping(real)` TO days_for_shipping_real;</pre><p>After successfully cleaning the data, it is then ready for analysis.</p><h4><strong>ANALYSIS</strong></h4><pre># Product Category with sales amount, profit, times ordered and profit margin<br><br>SELECT category_name, <br>       ROUND(SUM(order_item_total),2) AS total_sales,<br>       ROUND(SUM(order_profit_per_order),2) profit, <br>       COUNT(*) AS times_ordered,<br>    ROUND(ROUND(sum(order_profit_per_order),2)/ROUND(SUM(order_item_total),2) * 100,2) AS profit_margin<br>FROM datacosupplychaindataset<br>GROUP BY Category_Name<br>ORDER BY total_sales DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*Y2AjwL4i0N61tqSj8inglA.png" /></figure><p><em>The query shows the product categories with the total sales amount, profit, number of times ordered, and profit margin.</em></p><pre># Product Name with sales amount, profit, times ordered and profit margin<br><br>SELECT Product_Name, <br>    ROUND(SUM(order_item_total),2) AS total_sales, <br>       ROUND(SUM(order_profit_per_order),2) AS profit, <br>       COUNT(*) AS times_ordered, <br>    ROUND(ROUND(SUM(order_profit_per_order),2)/ROUND(SUM(order_item_total),2) * 100,2) AS profit_margin<br>FROM datacosupplychaindataset<br>GROUP BY Product_Name<br>ORDER BY total_sales DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*YtL54gQDojK8qDEN0QydSw.png" /></figure><p><em>The query shows the product name with the total sales amount, profit, number of times ordered, and profit margin.</em></p><pre># How many times were the various payment type used?<br><br>SELECT TYPE AS payment_type, <br>    ROUND(SUM(order_item_total),2) AS total_sales,<br>       COUNT(*) AS time_used<br>FROM datacosupplychaindataset<br>GROUP BY payment_type;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*qEQsrL612-g6L4nQfIDQ2g.png" /></figure><p><em>This query shows that Debit is mostly used for payment</em></p><pre># Customer Segment with sales amount, profit, times ordered and profit margin<br><br>SELECT customer_segment, <br>       ROUND(SUM(order_item_total),2) AS total_sales,  <br>       ROUND(SUM(order_profit_per_order),2) AS profit,<br>       ROUND(ROUND(SUM(order_profit_per_order),2)/ROUND(SUM(order_item_total),2) * 100,2) AS profit_margin,<br>       COUNT(*) AS total_orders<br>FROM datacosupplychaindataset<br>GROUP BY Customer_Segment<br>ORDER BY total_sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*uhtLiIKNVdrijixz6lRuMg.png" /></figure><p><em>The query shows the customer segment with the total sales amount, profit, number of times ordered, and profit margin.</em></p><pre># Seasonal Trends in sales based on order date by year<br><br>SELECT YEAR(order_date)  AS order_year ,<br>    ROUND(SUM(order_item_total),2) AS total_sales, <br>       ROUND(SUM(order_profit_per_order),2) AS profit, <br>       COUNT(*) as total_orders<br>FROM datacosupplychaindataset<br>GROUP BY order_year<br>ORDER BY sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*HAsTb0muo3BUvsYxTCJRzw.png" /></figure><pre># Seasonal Trends in sales based on order date by month<br><br>SELECT MONTHNAME(order_date) AS order_month ,<br>    ROUND(SUM(order_item_total),2) AS total_sales, <br>       ROUND(SUM(order_profit_per_order),2) AS profit,<br>       COUNT(*) AS total_orders<br>FROM datacosupplychaindataset<br>GROUP BY order_month<br>ORDER BY sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*btKho-GwNEmR4443gBVT6w.png" /></figure><pre># Seasonal Trends in sales based on order date by day in 2018<br><br>SELECT DAYNAME(order_date) AS order_day,<br>       ROUND(SUM(order_item_total),2) AS total_sales,  <br>       ROUND(SUM(order_profit_per_order),2) AS profit, <br>       COUNT(*) AS total_orders<br>FROM datacosupplychaindataset<br>WHERE Order_date LIKE &quot;2018%&quot; <br>GROUP BY order_day<br>ORDER BY sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*930oKd6sS9P9gP9gx5vULw.png" /></figure><p><em>This query shows the seasonal trends with the total sales amount, profit, and number of orders.</em></p><pre># What are the preferred product categories for different customer segments?<br><br>WITH ranked_categories AS ( SELECT<br>        customer_segment,<br>        category_name,<br>        ROUND(SUM(order_item_total) ,2) AS total_sales,<br>        ROW_NUMBER() OVER (PARTITION BY customer_segment ORDER BY SUM(order_item_total) DESC) AS category_rank<br>    FROM datacosupplychaindataset<br>    GROUP BY customer_segment, category_name<br>)<br>SELECT customer_segment,<br>       category_name,<br>    total_sales<br>FROM ranked_categories<br>WHERE category_rank = 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*W3xLdTcs7VtGHXNuZCCq2Q.png" /></figure><p><em>This query shows the list of customer segments along with their preferred product categories and the total sales amount for each combination. This way, we can easily identify the top-performing segments and categories.</em></p><pre># Customer Country with sales amount, profit, times ordered and profit margin<br>SELECT customer_country, <br>       ROUND(SUM(order_item_total),2) AS total_sales,  <br>       ROUND(SUM(order_profit_per_order),2) as profit,<br>       ROUND(ROUND(SUM(order_profit_per_order),2)/ROUND(SUM(order_item_total),2) * 100,2) AS profit_margin,<br>       COUNT(*) AS total_orders<br>FROM datacosupplychaindataset<br>GROUP BY Customer_Country<br>ORDER BY total_sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*ViMfbjdmQd0IT0QXuM7C4A.png" /></figure><p><em>This query shows the customer countries with the total sales amount, profit, and number of orders.</em></p><pre># The best selling category in customer_country<br><br><br>WITH ranked_country AS ( SELECT<br>   customer_country, <br>            category_name,  <br>            ROUND(SUM(order_item_total),2) AS total_sales,<br>                         ROW_NUMBER() OVER (PARTITION BY customer_country ORDER BY ROUND(SUM(Order_Item_Total),2) DESC) AS customer_countryrank<br>                         FROM datacosupplychaindataset<br>                         GROUP BY Customer_Country, Category_Name<br>                         )<br>     SELECT <br>                        customer_country,<br>                        category_name, <br>                        total_sales<br>     FROM ranked_country<br>     WHERE customer_countryrank = 1;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*2Ak8Va68OdpvS0BG8y28RQ.png" /></figure><p><em>This query shows the customer country along with their preferred product categories and the total sales amount for each combination. This way, we can easily identify the top-performing category in customer country</em></p><pre># Order Country with sales amount, profit, times ordered and profit margin<br><br>SELECT order_country,<br>       ROUND(SUM(order_item_total),2) AS total_sales,  <br>       ROUND(SUM(order_profit_per_order),2) AS profit,<br>       ROUND(ROUND(SUM(order_profit_per_order),2)/ROUND(SUM(order_item_total),2) * 100,2) AS profit_margin,<br>       COUNT(*) AS total_orders<br>FROM datacosupplychaindataset<br>GROUP BY Order_Country<br>ORDER BY total_sales DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*uEWKHYG3lqA06idThSf5NQ.png" /></figure><p><em>This query shows the order countries with the total sales amount, profit, and number of orders.</em></p><pre>#  Shipping modes with no of orders, percentage difference , expected delivery day and average late delivery risk<br><br>WITH total_orders AS ( SELECT <br>    shipping_mode, <br>                COUNT(shipping_mode) AS no_of_orders, <br>                CASE WHEN Shipping_Mode = &quot;Standard class&quot; THEN &quot;4 days&quot;<br>                WHEN Shipping_Mode = &quot;First class&quot; THEN &quot;1 day&quot; <br>                WHEN Shipping_Mode = &quot;second class&quot; THEN &quot;2 days&quot; <br>                WHEN Shipping_Mode = &quot;same day&quot; THEN &quot;same day&quot; <br>                END AS expected_delivery_day,<br>                AVG(Late_delivery_risk) AS avg_late_delivery_risk,<br>                ROUND(AVG(days_for_shipping_real),2) AS avg_real_shipping_days<br>    FROM datacosupplychaindataset<br>    GROUP BY shipping_mode<br>              )<br>     SELECT shipping_mode, <br>                        no_of_orders, <br>                        CONCAT(ROUND((no_of_orders/(SELECT SUM(no_of_orders) <br>                                                    FROM total_orders)) * 100, 2), &quot;%&quot;) AS percentage,<br>                        expected_delivery_day,<br>                        avg_real_shipping_days<br>                        avg_late_delivery_risk<br>                        FROM total_orders<br>                        GROUP BY shipping_mode;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*i3rKqjrRExuzTzxBEOmX5Q.png" /></figure><p><em>This query shows the different shipping modes and how many times they were used, the percentage, the expected delivery days, and the average delivery risk.</em></p><pre># Delivery Status<br><br>SELECT delivery_status,<br>       COUNT(*) AS value<br>FROM datacosupplychaindataset<br>GROUP BY Delivery_Status<br>ORDER BY value DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*LD_8P8AQRjAZhEcJPP9biA.png" /></figure><p><em>This query shows the overall delivery status, and we can see the most orders were delivered late.</em></p><pre># The most preferred shipping mode in customer_country<br><br>WITH ranked_shipping AS ( SELECT<br>                          Customer_Country, <br>                          COUNT(shipping_mode)  AS no_of_shipping, <br>                          shipping_mode, <br>      ROW_NUMBER() OVER (PARTITION BY customer_country ORDER BY COUNT(shipping_mode) DESC) AS customer_shipping_rank<br>      FROM datacosupplychaindataset<br>                        GROUP BY Customer_Country, Shipping_Mode)<br>                        SELECT customer_country, shipping_mode, no_of_shipping<br>                        FROM ranked_shipping<br>                        WHERE customer_shipping_rank = 1<br>                        GROUP BY customer_country;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*YRupeLxHGBs74paTYFRfDg.png" /></figure><p><em>This query shows both countries prefer standard-class modes of shipping.</em></p><pre># No of shipping by year<br><br>SELECT YEAR(order_date) AS order_year, <br>           COUNT(*) AS no_of_shipping<br>FROM datacosupplychaindataset<br>GROUP BY order_year <br>ORDER BY no_of_shipping DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*j4TvUayn7dYRd6-NBS0G0Q.png" /></figure><pre># No of Shipping by month<br><br>SELECT MONTHNAME(order_date) AS order_month,<br>    COUNT(*) AS no_of_shipping<br>FROM datacosupplychaindataset<br>GROUP BY order_month <br>ORDER BY no_of_shipping DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*0Ei-NNjnIsu87DELa0IW2w.png" /></figure><pre># No of shipping by week<br><br>SELECT DAYNAME(order_date) AS order_day, <br>       COUNT(*) AS no_of_shipping<br>FROM datacosupplychaindataset<br>GROUP BY order_day<br>ORDER BY order_day DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*6pXEIyX2kNbsReGFjRLLQg.png" /></figure><p><em>The query shows the seasonal trend of shipping.</em></p><p>INSIGHTS</p><p><strong>Sales, Orders, and Profitability Analysis</strong>: The product with the highest sales and profit is Perfect Fitness Perfect Rip, and the category leading in sales, profit, and orders is Cleats, totaling $470,265.45 in sales and $49,564.53 in profit. Perfect Fitness Perfect Rip is the top-selling product in this category. However, soccer has the highest profit ratio at 27.06%, while basketball has a profit ratio of 10.54%. The consumer segment leads in sales, orders, and profit with a profit ratio of 11.52%, but the corporate segment boasts the highest profit ratio at 12.76%. The Home Office segment, with a 10.74% profit ratio, has the fewest orders, sales, and profits.</p><p>The transfer payment mode is the only one associated with suspected fraudulent activities.</p><p><strong>Geographical Analysis:</strong> The dataset includes two geographies: customer location and order location. Puerto Rico is the customer country with the highest orders, sales, and profit, while the USA has the highest profit ratio. The USA also leads in order volume with 1636 orders, followed by France with 1242 orders, with clutches being the most ordered category in both countries.</p><p><strong>Delivery Analysis:</strong> There are four shipping modes: Same Day, First Class, Second Class, and Standard Class. Standard Class is the most utilized, with 9359 shipments, followed by Second Class with 2926. Standard Class is preferred due to its reliability and the lowest average late delivery risk of 0.39, compared to 0.53 for Same Day, 0.79 for Second Class, and 0.96 for First Class, which has the highest risk. Standard Class is favored across all customer segments and countries.</p><h4><strong>DASHBOARD</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z59SyN01_eQPesEB8pTNLw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsmMuzvKCW4wNV2uIrv0Cw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8c-X2U9TgvgZ8QBGVo5sFA.jpeg" /></figure><p>RECOMMENDATIONS</p><p>The data analysis has provided insights that have led to the following recommendations: :</p><p>The pricing policy in Puerto Rico needs to be reassessed to enhance profitability, while in America, increased advertising and promotions are necessary to boost order numbers.</p><p>The payment department must conduct thorough due diligence when processing payments, particularly for transfer payment methods, which are prone to fraud.</p><p>Furthermore, the shipping department should prioritize meeting delivery dates, especially for first-class shipping, to bolster customer trust in the shipping schedule and encourage more orders.</p><p>You can interact with the dashboard here <a href="https://app.powerbi.com/view?r=eyJrIjoiMTY3N2NlMDMtMTEyZC00MWRjLTgyMTAtZTkzNjg1NWFkZWRmIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9">https://app.powerbi.com/view?r=eyJrIjoiMTY3N2NlMDMtMTEyZC00MWRjLTgyMTAtZTkzNjg1NWFkZWRmIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9</a></p><p>Follow me on Twitter <a href="https://twitter.com/BZubair20">Gbolahannnnnnnn (@BZubair20) / X (twitter.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9058ff16bd3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WHO: Leading cause of DALYs and DEATHs]]></title>
            <link>https://medium.com/@BZubair20/who-leading-cause-of-dalys-and-deaths-9c96e0610605?source=rss-718799778e33------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c96e0610605</guid>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[daly]]></category>
            <category><![CDATA[world-health-organization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Toheeb Ogunmola]]></dc:creator>
            <pubDate>Wed, 22 May 2024 13:13:52 GMT</pubDate>
            <atom:updated>2024-12-08T13:24:41.869Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*fSdxP2lp422bCqhDOWFHFQ.png" /></figure><p><strong>Project Title</strong>: WHO: Leading cause of dalys and deaths</p><p><strong>Date</strong>: 22 May 2024</p><h4><strong>Introduction</strong></h4><p>The project focus on the most recent country-level estimates for the <strong>Top</strong> <strong>25 economies</strong> on cause-specific disability-adjusted life years (DALYs) and deaths for the years 2000, 2010, 2015, and 2019, provided by the World Health Organization.</p><h4><strong>Terminologies used in analysis</strong></h4><p><strong>Country</strong>: The Country name. The countries involved in the analysis are as follows.</p><blockquote>Australia</blockquote><blockquote>Belgium</blockquote><blockquote>Brazil</blockquote><blockquote>Canada</blockquote><blockquote>China</blockquote><blockquote>France</blockquote><blockquote>Germany</blockquote><blockquote>India</blockquote><blockquote>Indonesia</blockquote><blockquote>Iran</blockquote><blockquote>Italy</blockquote><blockquote>Japan</blockquote><blockquote>Mexico</blockquote><blockquote>Netherlands</blockquote><blockquote>Poland</blockquote><blockquote>Republic of Korea</blockquote><blockquote>Russia</blockquote><blockquote>Saudi Arabia</blockquote><blockquote>Spain</blockquote><blockquote>Sweden</blockquote><blockquote>Switzerland</blockquote><blockquote>Thailand</blockquote><blockquote>United Kingdom and Northern Ireland</blockquote><blockquote>USA</blockquote><p><strong>GHE Cause Type</strong>: The term GHE cause type refers to the categories of cause of death and disability and disability used in the World Health Organization’s (WHO) Global Health Estimate (GHE). The cause is grouped into three broad cause groups namely:</p><blockquote><strong>.</strong> Group 1: Communicable, maternal, perinatal and nutritional conditions.</blockquote><blockquote><strong>.</strong> Group 2: Non-communicable diseases.</blockquote><blockquote><strong>.</strong> Group 3: Injuries</blockquote><p><strong>GHE Cause Title</strong>: The term “GHE Cause Title” is used in the context of the World Health Organization’s (WHO) Global Health Estimates (GHE). It refers to the specific name given to a cause of death or disability. For example, a GHE Cause Title could be a specific disease like “ischemic heart disease” or a category of conditions like “Communicable, maternal, perinatal, and nutritional conditions”. Each cause falls under one of the three broad cause groups mentioned earlier.</p><p><strong>Year</strong>: Year of reporting which is between 2000 and 2019</p><p><strong>Sex</strong>: Age group of the population for the corresponding sex for the reporting year</p><p><strong>Age group</strong>: Age group of the population for the corresponding sex for the reporting year</p><p><strong>Population</strong>: Total number of people in corresponding age group and sex for the reporting year</p><p><strong>Deaths</strong>: Total deaths occurred within the corresponding age group and sex for the reporting year due to the corresponding condition/disease</p><p><strong>Daly: </strong>One DALY represents the loss of the equivalent of one year of full health. DALYs for a disease or health condition are the sum of the years of life lost to due to premature mortality (YLLs) and the years lived with a disability (YLDs) due to prevalent cases of the disease or health condition in a population.</p><h4>Objectives</h4><ol><li><strong>Trend Analysis</strong>: How has the DALYs and death rate changed over time (2000, 2010, 2015, and 2019) for each country? Are there any noticeable trends or patterns?</li><li><strong>Comparison Analysis</strong>: How do the DALYs and death rates compare among the top 25 economies? Which countries have the highest rates?</li><li><strong>Cause Analysis</strong>: What are the most common causes of DALYs and deaths in these countries? Are there specific causes that are more prevalent in certain countries?</li></ol><p>The dataset was downloaded from Kaggle, and I loaded it into<strong> Power BI</strong> for the analysis and visualization.</p><p>The first and most crucial step of data analysis is data cleaning. The following steps were taken using Power Query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*REXBsLVTvwlZXprO8OTYsg.png" /><figcaption>Data cleaning steps</figcaption></figure><p>After cleaning the data, I reloaded the dataset into Power BI to create the measures required for the analysis using DAX (Data Analysis Expressions).</p><p><strong>DAX measures created</strong></p><p>I created a DAX code to calculate the total population in the dataset. I avoided using the SUM function since each age group is evaluated for every GHE Cause type, leading to duplicate values in the population column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*933udLd7Z8ywK0XiG06m5A.png" /><figcaption>This is table showing the duplicate population value for years 0–1 for Australia</figcaption></figure><p>In order to avoid calculating duplicate values, I used the SUMX function to sum the distinct value of the population column</p><pre>Total Population = SUMX(DISTINCT(data[POPULATION]),data[POPULATION])<br></pre><p>Having created the sum of population, I used the value to create the DEATH AND DALY rate. writing this DAX code</p><pre>Total Death Rate = DIVIDE([Total Deaths],[Total Population],0)<br>Total Daly Rate = DIVIDE([Total Daly],[Total Population],0)</pre><p>This is the table of measures used in this analysis and visualization</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*QWxGbCFCuHQ93tNF45Mk7g.png" /><figcaption>Measures table</figcaption></figure><p>The project categorizes 131 GHE CAUSE TITLES into three distinct GHE CAUSE TYPES as defined in the project’s terminologies. To identify which GHE CAUSE TITLE belongs to a specific GHE CAUSE TYPE, I implemented conditional formatting that assigns unique colors to each GHE CAUSE TYPE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJXIoPN0WgGj0lVfobpEkQ.png" /><figcaption>conditional formatting</figcaption></figure><p>The outcome of the conditional formatting indicates that ischemic heart disease is categorized as a non-communicable disease, neonatal conditions are grouped under communicable, maternal, perinatal, and nutritional conditions, and road injuries are classified as injuries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxcnLbdWlUavd39HkbQs-g.png" /></figure><h3>ANALYSIS AND VISUALIZATION</h3><p>The <strong>Rate</strong> metric is mostly utilized in this analysis, particularly when comparing countries, as it offers insightful perspectives by considering the population size, thereby enabling fair comparisons across countries of varying sizes.</p><h4>DALY</h4><p>The five countries with the highest DALY rates are as follows: <strong>Russia</strong> leads with a rate of 45.66%, followed by <strong>India</strong> at 38.86%, <strong>Indonesia</strong> at 30.54%, the <strong>USA</strong> at 26.62%, and <strong>China</strong> at 24.68%.</p><p><strong>Ischemic</strong> <strong>heart disease</strong> ranks as the leading cause of disability-adjusted life years (DALYs) in the counties in this analysis, primarily affecting individuals over 40, except in countries like <strong>Brazil</strong>. There, <strong>interpersonal</strong> <strong>violence</strong> tops the list for DALYs among those aged 15 to 44. In <strong>China</strong>, <strong>Indonesia</strong>, <strong>Japan</strong>, and <strong>Korea</strong>, <strong>stroke</strong> is the predominant cause of DALYs, with the typical age of onset being over 40 in <strong>China</strong>, over 45 in <strong>Indonesia</strong>, over 55 in <strong>Japan</strong>, and over 50 in <strong>Korea</strong>. <strong>Mexico</strong> sees <strong>diabetes</strong> <strong>mellitus</strong> as the main cause, most frequently in the 40 to 79 age brackets. In <strong>India</strong>, <strong>neonatal</strong> <strong>conditions</strong> lead to the highest DALYs, especially from ages 0 to 1, comprising 38.86% of DALYs. In <strong>Thailand</strong>, <strong>HIV/AIDS</strong> is the primary cause of DALYs, with significant rates in the 1 to 4 and 25 to 49 age groups.</p><p>The top five causes of disability-adjusted life years (DALYs) across all 25 countries analyzed are <strong>ischemic heart disease, neonatal conditions, stroke, chronic obstructive pulmonary disease, </strong>and<strong> lower respiratory infections respectively.</strong></p><p>The primary cause of disability-adjusted life years (DALYs) in children aged 0 to 1 is <strong>neonatal conditions</strong>. For ages 1 to 14,<strong> diarrhoeal diseases</strong> are the most common cause. Individuals aged 15 to 39 are most susceptible to<strong> road injuries</strong>, while those aged 40 and above are predominantly affected by <strong>ischemic heart diseases.</strong></p><p><strong>Males</strong> have a higher rate of DALY, with a 53.57% incidence, and the leading cause of DALY for males is <strong>ischemic heart disease</strong>. <strong>Females</strong> have a 46.13% DALY rate, with <strong>neonatal conditions</strong> being the predominant cause.</p><p>The DALY rate showed a downward trend, resulting in a 21.30% <strong>decrease</strong> from 2000 to 2019.</p><h4>DEATHS</h4><p>The five countries with the highest death rates are as follows: <strong>Russia</strong> leads with a 1.34% death rate, followed by the <strong>USA</strong> at 0.72%, <strong>India</strong> at 0.70%, <strong>China</strong> at 0.65%, and <strong>Indonesia</strong> at 0.63%.</p><p><strong>Ischemic heart disease </strong>ranks as the leading cause of death in the majority of countries analyzed, with a significant risk of mortality starting at age 45. Conversely, in nations such as <strong>China, Indonesia, Korea, and Thailand</strong>, <strong>stroke</strong> emerges as the predominant cause of death, presenting a high risk to individuals from the age of 40.</p><p>The top five leading causes of death in the 25 countries analyzed in this project are <strong>ischemic heart disease, stroke, chronic obstructive pulmonary disease, lower respiratory infections, and trachea, bronchus, </strong>and<strong> lung cancers,</strong> respectively.</p><p>The leading cause of death in children aged 0 to 1 is <strong>neonatal conditions.</strong> <strong>Diarrheal diseases </strong>are the most common cause of death for ages 1 to 14. For individuals aged 15 to 39, <strong>road injuries</strong> are the most prevalent cause of death, while <strong>ischemic heart diseases </strong>primarily affect those aged 40 and above.</p><p><strong>Males</strong> have the highest mortality rate in this analysis, accounting for 54.79% of all deaths, with <strong>ischemic heart disease</strong> being the leading cause. <strong>Females</strong> have a mortality rate of 45.21%, with <strong>ischemic heart disease </strong>also being the predominant cause of death.</p><p>The Death rate dropped from 0.73% to 0.67% during its steepest <strong>decline</strong> between 2000 and 2019.</p><h4>THE DASHBOARD</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0bXhjvtZvctr5FYq_ejYw.jpeg" /><figcaption>WHO: Leading cause of death and Dalys</figcaption></figure><h4>RECOMMENDATIONS</h4><p>1. Health Policy and Resource Allocation</p><p><strong>Ischemic Heart Disease</strong>: As the leading cause of DALYs and deaths across most countries, prioritize funding for prevention programs, early detection, and treatment, such as hypertension management and promoting healthy lifestyles.</p><p><strong>Neonatal Conditions:</strong> Increase investment in maternal and neonatal healthcare, especially in countries like India, where neonatal conditions significantly contribute to DALYs.</p><p><strong>Stroke</strong>: Enhance stroke awareness campaigns and improve access to emergency care, particularly in countries like China, Indonesia, Japan, and Korea.</p><p>2. Age-Specific Interventions</p><p>Children (0–14): Focus on reducing neonatal and diarrheal diseases through improved prenatal care, vaccination programs, and access to clean water and sanitation.</p><p>Youth and Young Adults (15–39): Implement road safety measures, including stricter traffic regulations and public awareness campaigns, to reduce road injuries.</p><p>Adults (40+): Encourage routine health screenings to identify and manage ischemic heart disease and stroke risk factors.</p><p>3. Gender-Specific Health Strategies</p><p>Men: Target ischemic heart disease prevention through workplace wellness programs and campaigns tailored to address male-specific health challenges.</p><p>Women: Focus on neonatal and maternal health services, and increase outreach for chronic disease prevention among women.</p><p>4. Global Collaboration and Knowledge Sharing</p><p>Countries facing similar challenges (e.g., stroke in East Asia, neonatal conditions in developing economies) should collaborate to share effective policies and innovations.</p><p>WHO and global health agencies should facilitate workshops and initiatives to disseminate successful practices in reducing DALYs and deaths.</p><p>5. Monitoring and Evaluation</p><p>Continuously track DALY and death rates using updated data from WHO and other global health databases.</p><p>Establish performance metrics to evaluate the effectiveness of implemented health interventions and make adjustments as necessary.</p><p>6. Public Awareness and Education</p><p>Conduct campaigns on healthy lifestyles, smoking cessation, and dietary habits to mitigate non-communicable diseases.</p><p>Partner with community leaders and organizations to enhance outreach and ensure cultural relevance in health promotion.</p><p>7. Leveraging Technology</p><p>Use health data analytics platforms to identify emerging health trends and target interventions more effectively.</p><p>Promote telemedicine and e-health solutions to improve access to care in underserved regions.</p><p>CONCLUSION</p><p>In conclusion, while the leading causes of DALYs and deaths vary by country, and age groups, many can be prevented or mitigated through a combination of healthy lifestyle choices, regular health checkups, personal decisions and societal interventions. It’s also important to tailor prevention strategies to the specific health challenges faced by each country and age groups.</p><p>You can interact with the dashboard here <a href="https://app.powerbi.com/view?r=eyJrIjoiYzBjZmFmZGMtMGZiYy00M2I1LTk4MTItOWU4Mjc5ZTc3Y2RjIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9">https://app.powerbi.com/view?r=eyJrIjoiYzBjZmFmZGMtMGZiYy00M2I1LTk4MTItOWU4Mjc5ZTc3Y2RjIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9</a></p><p>Follow me on X <a href="https://twitter.com/BZubair20">Gbolahannnnnnnn (@BZubair20) / X (twitter.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c96e0610605" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real Estate Analysis Using Power BI by Ogunmola Toheeb]]></title>
            <link>https://medium.com/@BZubair20/real-estate-analysis-using-power-bi-by-ogunmola-toheeb-60185925e1fb?source=rss-718799778e33------2</link>
            <guid isPermaLink="false">https://medium.com/p/60185925e1fb</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis-expression]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Toheeb Ogunmola]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 18:33:01 GMT</pubDate>
            <atom:updated>2024-04-29T18:33:01.620Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ZN-YZR8Iug0G5CShUP2UrQ.jpeg" /></figure><p><strong>Project Title: </strong>Real Estate Analysis</p><p><strong>Date: </strong>April 29, 2024</p><h4>Introduction</h4><p>The Office of policy Management maintains a listing of all real estate sales with a sales price of $2,000 or greater that occur between January 1 and December 30 of each year. For each sale record, the file includes town, property address, date of sale, residential type (Condo, Single Family, Two Family, Three Family and Four Family), sales price, and property assessment.</p><h4>Terminologies used in analysis.</h4><p><strong>List Year</strong>: This is the year that the property was listed for sale and open to buyer to make offers.</p><p><strong>Date Recorded</strong>: This is the date that the property was sold to the buyer.</p><p><strong>Town</strong>: Location of Property.</p><p><strong>Assessed</strong> <strong>Value</strong>: It serves as an accepted dollar value for the property and a reliable indicator of its worth.</p><p><strong>Sales</strong> <strong>Amount</strong>: The amount the property was sold.</p><p><strong>Residential</strong> <strong>Type</strong>: The type of property (e.g. Single-Family, Condo, Two-Family, Three-Family or Four-Family).</p><p><strong>Objectives</strong></p><p>1. Descriptive Analysis: <br> — What is the sales price for each property type?<br> — What is the most common property type on sale?<br> — Which town has the highest number of properties for sale?<br> — What is the distribution of sales prices across different towns?</p><p>2. Temporal Analysis:<br> — What is the trend of sales prices over time? <br> — Are there any seasonal patterns in property sales (e.g., more sales in certain months)?</p><p>3. Comparative Analysis:</p><p>— Are there any geographical patterns in property sales (e.g., higher prices in certain towns)?<br>— Are there certain types of properties that tend to sell for more than their assessed value?</p><p>I loaded the dataset into Power BI</p><h4><strong>Data Cleaning</strong></h4><p>The first and most crucial step in analysis is <strong>data</strong> <strong>cleaning</strong>. Power Query was utilized for data cleaning and transformation.</p><p>The following steps were undertaken to ensure data validation:</p><figure><img alt="Data cleaning steps" src="https://cdn-images-1.medium.com/max/568/1*EQ3XxNnF2whCKwGZGa8avA.png" /><figcaption>Data cleaning steps</figcaption></figure><p>After cleaning the data, I reloaded the dataset into Power BI to create the calculated columns and measures required for the analysis using DAX (Data Analysis Expressions).</p><ul><li>I wrote this DAX code to add a new column that extracts the YEAR from the DATE RECORDED.</li></ul><figure><img alt="Creating Year column" src="https://cdn-images-1.medium.com/max/662/1*L2uKRdfSGQg3CEdTe1C7oA.png" /><figcaption>Creating YEAR column</figcaption></figure><ul><li>I created a column that displays the number of years between the listing and the sale of each property, categorizing them into groups of the same year, 1 year, 2 years, and 3 years.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnxOXsg82tWjHBuExQ6klQ.png" /><figcaption>Year difference grouping</figcaption></figure><ul><li>I added a new column to display the percentage difference between the property’s sale price and its assessed value.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*mMhiJP3WCZ3DkNxno27QrA.png" /><figcaption>Sales amount percentage difference</figcaption></figure><ul><li>To categorize the sale prices of properties into groups such as Premium, High, Medium, and Low, I used the Percentile formula in DAX. By this method, amounts greater than or equal to the 3rd Quartile would be classified as “Premium,” those greater than or equal to the 2nd Quartile as “High,” those greater than or equal to the 1st Quartile as “Medium,” and all others as “Low.” This approach helps to avoid bias, with the highest property sale being $48,000,000 and the lowest at $2,000.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UypoUHsZzAE52p-tfv34WQ.png" /><figcaption>Price Range grouping</figcaption></figure><ul><li>Finally, I have created the necessary measures for analysis and visualization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*j7nHsLWkq9mUOE0ZOH8dvA.png" /><figcaption>Measures table</figcaption></figure><h4>ANALYSIS AND VISULIZATION</h4><ul><li>The Single-Family residential category leads with the highest total sales, valued at <strong>$188,930,673,051</strong>, accounting for <strong>83.22%</strong> of the total sales volume. This is followed by Condos with a total sales value of <strong>$28,137,719,165</strong>. In third place is Two-Family homes at <strong>$6,425,856,436</strong>, with Three-Family homes in fourth at <strong>$2,860,576,365</strong>, and Four-Family homes trailing with the lowest at <strong>$669,489,501</strong>.</li><li>Single-Family homes are the most commonly purchased residential type, with <strong>439,978</strong> acquisitions, accounting for <strong>73.67</strong>% of total purchases. Condos are a distant second with <strong>117,421</strong> purchases, followed by Two-Family homes at <strong>25,808</strong>. Three-Family homes have been purchased <strong>11,909</strong> times, and Four-Family homes are the least common, with <strong>2,107</strong> purchases.</li><li>Stamford leads in property sales with a total of <strong>18,148</strong> properties sold, closely followed by Norwalk with <strong>15,277</strong> properties. Although Greenwich does not rank among the top five towns for the number of properties sold, it tops the list for the highest sales amount at <strong>$24,615,523,692</strong>, accounting for <strong>10.84%</strong> of the total sales. This indicates that properties in Greenwich are predominantly of premium value. Stamford follows with <strong>$9,900,123,283</strong> in sales, making up <strong>4.36%</strong> of the total sales.</li><li>The Real Estate Industry has experienced significant growth over the years. The total number of properties sold has seen a substantial increase, with a <strong>313.04%</strong> rise from 2006 to 2022. The upward trend in property sales began in 2016, with an increase of <strong>30.75%</strong>, amounting to <strong>$3,771,650,975</strong> over six years. June recorded the highest total amount of properties sold at <strong>$26,157,920,371</strong>, which was <strong>138.32%</strong> higher than February, the month with the lowest sales at <strong>$10,975,957,745</strong>. June contributed to <strong>11.52%</strong> of the annual total properties sold. The sales volume across all five residential types varied, with numbers ranging from <strong>2,107</strong> to <strong>439,978</strong>.</li><li>In the first year following the listing date, a significant portion of the properties were sold, with <strong>444,692</strong> out of the total <strong>597,223</strong> properties being purchased, representing a sales rate of <strong>74.46%</strong>.</li><li>Property prices vary significantly across towns, with areas like <strong>Stamford</strong>, <strong>Greenwich</strong>, and <strong>Fairfield</strong> typically commanding higher prices. In contrast, towns such as <strong>Waterbury</strong>, <strong>Bridgeport</strong>, and <strong>New</strong> <strong>Britain</strong> often have more affordable property options.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*I2cypf62MjkqYHRhKNpoQQ.png" /><figcaption>Towns that fall into the premium price range</figcaption></figure><ul><li>Three-Family residential properties tend to sell at the highest rates above their assessed values, with a <strong>43.26%</strong> difference in sales price compared to the assessed value, followed by Four-Family properties at <strong>42.27%</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*b33Qfn4DevncacUjxKXFHQ.png" /><figcaption>Table showing the sales percentage difference with different residential type.</figcaption></figure><h4><strong>Dashboard</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQst_iV3OCpkqD6psI5D9g.jpeg" /><figcaption>Real Estate Dashboard</figcaption></figure><h4>Conclusion</h4><ul><li>Single-Family homes are the most sold and in-demand residential type, yet Three-Family homes often sell for more than their assessed property value. Properties in Greenwich typically sell at higher prices compared to other towns. To drive more sales, advertising should be concentrated in February.</li></ul><p>You can interact with the dashboard here<a href="https://app.powerbi.com/view?r=eyJrIjoiOWUzYjI0YjMtZTI1OS00ODE2LTlkNTYtOWExYWUwMWUzNjlmIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9"> https://app.powerbi.com/view?r=eyJrIjoiOWUzYjI0YjMtZTI1OS00ODE2LTlkNTYtOWExYWUwMWUzNjlmIiwidCI6ImRmODY3OWNkLWE4MGUtNDVkOC05OWFjLWM4M2VkN2ZmOTVhMCJ9</a></p><p>You can follow me on Twitter <a href="https://twitter.com/BZubair20">Gbolahannnnnnnn (@BZubair20) / X (twitter.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60185925e1fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>