<?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 Suliyat Abimbola on Medium]]></title>
        <description><![CDATA[Stories by Suliyat Abimbola on Medium]]></description>
        <link>https://medium.com/@zullyheart3?source=rss-f87d2c11b2ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Suliyat Abimbola on Medium</title>
            <link>https://medium.com/@zullyheart3?source=rss-f87d2c11b2ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 20:26:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zullyheart3/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[US International Travel Analysis]]></title>
            <link>https://medium.com/@zullyheart3/us-international-travel-analysis-7e2dcfe815d1?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e2dcfe815d1</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Fri, 04 Jul 2025 11:42:00 GMT</pubDate>
            <atom:updated>2025-07-04T11:42:00.541Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>INTRODUCTION</strong></p><p>International travel plays a vital role in the United States’ economy and global engagement. This project explores over three decades of outbound travel data from the U.S., covering the years 1990 to 2021. The dataset includes detailed records of the number of U.S. citizens traveling abroad by region, year, and month, offering a comprehensive view of how American travel — highlighting preferred destinations, the impact of global events on travel behavior, and overall travel growth.</p><p>By examining historical data, this project aims to identify key trends, uncover regional differences, and support strategic decision-making for stakeholders in the travel and tourism industry, such as airlines, policymakers, and travel agencies. The findings are visualized using interactive tools to enhance understanding and usability.</p><p><strong>OVERVIEW OF THE DATASET</strong></p><p>The dataset contains 17,217 rows and 3 columns which are the countries, date and total passengers. The dataset ranges from year 1990 to 2021. The weekday and month were retrieved from the date column using the TEXT function.</p><p>=TEXT([date_column],”ddd”) — — for weekday</p><p>=TEXT([date_column],”mmm”) — — — for month</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*Ce3P1Lulj7lISDHqIq7EEg.png" /><figcaption>Overview of the Dataset</figcaption></figure><p><strong>INSIGHTS GOTTEN FROM THE ANALYSIS</strong></p><p>The analysis was carried out using pivot table in Microsoft Excel.</p><p>Total countries visited by the United State citizens is 46, total number of passengers are 4billion and the dataset span from 1990 to 2021.</p><p>The most travelled destination by the United State citizens is Canada, Mexico and United Kingdom.</p><p>In 2020, Mexico, Canada and United Kingdom accounted for about 43% of the total United State travel destination. While in 2021, Mexico, Dominican Republic and Colombia accounted for about 56% of the total United State travel destination.</p><p>The analysis shows the Quarterly Basis of how the US citizens travelled. While the differences were marginal, a slight increase was observed in Qtr2 and Qtr3, possibly due to Spring and Summer travel seasons, which are typically peak periods for vacations and tourism. Qtr4’s slight decline may reflect the winding down of travel activities toward the end of the year.</p><p>There isn’t much difference in the monthly passenger trend, as the average monthly passenger is 349million. The month with the highest number of travelers is July with 410million passengers while the least Month is February with 296million passengers. The data shows that passenger increases from spring into summer, peaks in July and then gradually decline towards the end of the year.</p><p>The analysis shows that a consistently high level of weekly travel with no extreme spikes or drops, supporting the notion that United State international travel is evenly distributed across the week.</p><p><strong>VISUALIZATION</strong></p><p>This represents the graphical representation of the insights gotten from the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*G_-BoYxVxwW5-xE6fbUGzg.png" /><figcaption>US International Travel Dashboard</figcaption></figure><p><strong>CONCLUSION</strong></p><p>The analysis of U.S. international travel from 1990 to 2021 reveals a pattern of overall stability with seasonal and regional fluctuations. On a quarterly basis, passenger volume remained relatively steady, with only minor variations. Weekly trends indicate that Sunday is the most traveled day, while Wednesday records the least number of passengers, reflecting typical travel behavior linked to weekend plans and business schedules.</p><p>Regionally, the top 10 most-traveled destinations highlight the dominance of neighboring countries, with Canada, Mexico, and the UK leading the list, reflecting ease of access, cultural ties, and economic relationships. Other key destinations include Brazil and South Korea, indicating sustained interest in South America and East Asia.</p><p>In summary, the data demonstrates a strong and consistent pattern of outbound U.S. travel, shaped primarily by seasonal, regional, and cultural factors. These insights can help travel stakeholders plan resources, promotions, and services in alignment with traveler behavior across time and regions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e2dcfe815d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SUPERSTORE SALES DATASET USING EXCEL]]></title>
            <link>https://medium.com/@zullyheart3/superstore-sales-dataset-using-excel-8b70783cff5d?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b70783cff5d</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 15:18:25 GMT</pubDate>
            <atom:updated>2025-07-03T15:18:25.390Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>INTRODUCTION</strong></p><p>The superstore dataset is a retail dataset that provides valuable insights into sales, customer behavior, and product performance. The dataset is comprehensive and encompasses sales transactions, understanding buying patterns, identify high-demand products and the effectiveness of different shipping mode. It also provides an opportunity to examine the impact of various factors such as discounts, locations, profit, products and so on.</p><p><strong>OBJECTIVES OF THIS PROJECT</strong></p><p>1. The most performing segment by sales and profit.</p><p>2. The best performing top 10 best performing products.</p><p>3. The best regional manager in terms of profit.</p><p>4. The most preferred shipping mode.</p><p><strong>OVERVIEW OF THE DATASET</strong></p><p>The superstore dataset contains 10,000 rows and 20 columns of data. The dataset was explored to understand what the data is all about. Firstly, it was cleaned by removing duplicates, searching for missing values/empty cells, rearranging of the scattered serial numbers and making sure it was ready for analysis.</p><p>In this dataset, we have three (3) different sheets, which are;</p><p>· Orders: This table contains the order details of all customers. Like the order id, ship mode, customer name, product segments, price, location, profit, etc.</p><p>· Returns: This table helps us to know if the products ordered were returned or not.</p><p>Regions: This table helps us to know the region of each store and the regional managers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MH8gR2bUvUeLRdNcEHkNAw.png" /><figcaption>The Orders Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*FdYa084bUfuxKDDrwNjGrg.png" /><figcaption>The Returns Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*tfOS8beJLNluJXGa1o5s1g.png" /><figcaption>The Regions Table</figcaption></figure><p>After cleaning the dataset, all the 3 tables/sheets were combined to 1 table/sheet by using the lookup function.</p><p>To know whether a product was returned or not, the XLOOKUP function was used.</p><p>=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]).</p><p>The above function was used to know whether a product was returned or not. Since we have the return table.</p><p>Also, to merge the Regions table to the Orders table, the XLOOKUP function was also used. Just the same format with the Returns table.</p><p>Lookup_value is the value to be searched for.</p><p>Lookup_array is the range where the value will be search from.</p><p>Return_array is the range that contains the value to be returned.</p><p>[if_not_found] is when the value to returned isn’t found.</p><p>[match_mode] specifies the match type; whether exact or approximately.</p><p>[search_mode] specifies the search direction; whether horizontal or vertical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UJX4rb40UznnZmPfhIYq9Q.png" /><figcaption>After merging the Returns and Regions Tables</figcaption></figure><p>Some needed metrics where also calculated for. Like the sales amount, profit margin, profit amount, and shipping days.</p><p>To get the sales amount, we were given the amount of one unit of the product. There are some customers that got more than a unit. We needed to also know if they were given discount or not which will reflect in their total amount.</p><p>Therefore, we did;</p><p>(Sales*Quantity) — (Sales*Quantity*discount) = Sales Amount.</p><p>To get the profit, we were only given the profit for a unit of product. So, we needed to calculate the profit because of customers that got more than one unit.</p><p>We have;</p><p>Profit*Quantity = Profit Amount.</p><p>We also calculated for the Profit margin.</p><p>Profit Amount / Sales Amount = Profit Margin.</p><p>To get the shipping days, we subtracted the Ship Date from the Order Date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*oRioCUyAz7xXandrf-zHzg.png" /><figcaption>View of some calculated metrics</figcaption></figure><p><strong>INSIGHT GOTTEN FROM THE DATASET</strong></p><p>The pivot table was used to get insight from the dataset, and the objectives of the project were achieved.</p><p>From the analysis, we got that the total sales for superstore sales from the year 2015 to 2018 is <strong>£13.33million</strong> and the total profit is approximately <strong>£1.9million</strong>. The Total Quantity of products ordered is 37,773 and the average discount is 10%. This also indicate an overall Profit Margin of <strong>13.9%.</strong></p><p>The total quantity of returned products is 2,102.</p><p>There are 3 regions, we have the North, South and Central Regions. The best performing region is the Central region with approximately £7.7million in sales where the category that generated the most sales is the Furniture category. This analysis also provides us the best regional manager which is EMILY BURNS of the Central Region.</p><p>There are 3 segments, the Consumer, Corporate and the Home office. The best performing segments is the Consumer segment with total sales of £6.83miilion, and Profit of £910,000; followed by the Corporate segment with total sales of £4.34million, and profit of £670,000 and the Home office with total sales of £2.16million, and Profit of £260,000.</p><p>There are 4 shipping mode, the Standard class, First class, Second class and Same class. The analysis shows that the most preferred ship mode is the Standard class, follows by the Second class.</p><p>Further analysis shows that the top-performing countries in the Central Region are France, Germany and United Kingdom while the least are Portugal, Ireland and Denmark.</p><p>We also have the top 10 sales by sub-category and the highest were Copiers and Phones.</p><p>NB: The dashboard is an interactive dashboard; it will help to explore the data to generate more insights.</p><p><strong>VISUALIZATION</strong></p><p>This is the graphical representation of the insights gotten from the dataset. it is an interactive dashboard that helps to explore the findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*LfCehe4URZ8Zrm91O9h0UA.png" /><figcaption>Dashboard Visualization</figcaption></figure><p><strong>RECOMMENDATION</strong></p><p>1. The consumer segment generates the most revenue and also the highest profit, the stakeholders should invest more in this segment while also try to improve on other segments.</p><p>2. The North and South regions underperform; targeted promotions should be considered and also operational adjustment i.e price adjustment and also shipping if necessary to boost sales.</p><p>3. The shipping mode can also be investigated. Same Day can be scaled affordably for high-valued orders.</p><p>4. Analyze what makes EMILY BURNS successful and replicate the practices across other regions.</p><p>5. Investigate why some products were returned, was it caused by damage while shipping or the customers didn’t get the quality of product expected.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b70783cff5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UNLOCKING SALES INSIGHTS WITH POWER BI.]]></title>
            <link>https://medium.com/@zullyheart3/unlocking-sales-insights-with-power-bi-26f555ccd884?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/26f555ccd884</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Sun, 29 Jun 2025 11:19:53 GMT</pubDate>
            <atom:updated>2025-06-29T11:24:29.628Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>INTRODUCTION</strong></h3><p>This project explores a sample sales dataset to uncover insights related to revenue trends, products performance, regional sales distribution using power bi.</p><p>The data was cleaned, transformed, analyzed and visualized to answer key business questions such as;</p><p>Which product category generate the most revenue?</p><p>What months/year contribute most to the total sales?</p><p>How do sales trend change over time?</p><p>The goal of this analysis is to demonstrate my ability to work with structed business data, identify meaningful patterns and present findings through clear, interactive visualizations.</p><p>Key Skills Demonstrated: Data cleaning, KPI tracking, trend analysis, storytelling with data and visualization.</p><p><strong>OVERVIEW OF THE DATASET</strong></p><p>The sales data contains 2,000 rows and 13 columns. The dataset was explored using Excel to understand each column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*p4pgS8i8VaG5wE4UgLVZfA.png" /><figcaption>Preview of the dataset</figcaption></figure><p>After exploring the dataset, it was loaded to power query editor through Power BI. The dataset was broken into tables to establish a relationship between them.</p><p>The dataset was broken down into 3 dimension tables, which are DimLocation, DimProduct, and DimSalesChannel and one fact table. The dimension tables contain the categorical data while the fact table contains the numeric/measurable data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*C51nTGlEgq8fCiDkAJ1lqg.png" /><figcaption>Preview of the dataset on Power Query</figcaption></figure><p><strong>DimLocation:</strong> This table contains the locations of customers; the region and state of each customer. A primary key was introduced to create a relationship between this table and the fact table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*rO6YrEiBa0hQj7CpMCYVIQ.png" /><figcaption>Dimension Location Table with Primary key</figcaption></figure><p><strong>DimProduct:</strong> This table contains the products ordered by each customer; the product category and product name. A primary key was introduced to create a relationship between this table and the fact table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*62Si0XPegfqQq2xWqy4F0w.png" /><figcaption>Dimension Product Table with Primary key</figcaption></figure><p><strong>DimSalesChannel:</strong> This table contains the channel each customer used in ordering their products. It has 4 different channels which are social media, website, in-store and mobile app. A primary key was introduced to create a relationship between this table and the fact table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CcEIdfABUr-ESZbvnGXtFQ.png" /><figcaption>Dimension Sales Channel Table with Primary key</figcaption></figure><p><strong>FactTable:</strong> This table contains all the measurable data like price, revenue, profit, date, and all the primary keys of the dimension tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sTg_t98yafk2WE8pZHFPnA.png" /><figcaption>Fact Table conatining all the dimension tables Primary key</figcaption></figure><p>After the relationships were created, the dataset was loaded to the Power BI.</p><p>Base measure was created. Measure in Power BI is a calculated field used to perform dynamic aggregation based on user interaction within a report. It is used to analyze data. The base measure is used to get the Profit margin, Total customer, Total quantity, Total profit and Total revenue.</p><p><strong>INSIGHTS GOTTEN FROM THE DATASET</strong></p><p><strong>REVENUE:</strong> The year 2024 generated more revenue than any other year, with a total of approximately $2.08 million. <strong>November</strong> was the top revenue-generating month, with $202,000 in sales. The <strong>Electronics </strong>category dominated revenue streams, generating $1.28 million, while the <strong>Website</strong> was the most effective sales channel, bringing in $540,000.</p><p><strong>PROFIT:</strong> The year 2024 not only generated the highest revenue, but also yielded the highest profit. With the profit approximately $623,000. The increased sales had a direct impact on profitability. November’s strong performance, coupled with the success of the Electronics category and the Website sales channel, contributed to the profitability.</p><p><strong>CUSTOMER:</strong> The customer purchase trends have varied significantly across product categories over the years.</p><p><strong><em>2021:</em></strong><em> Electronics were the top-selling category with 1,698 customers.</em></p><p><strong><em>2022 and 2023:</em></strong><em> Home Appliances took the lead with 1,629 and 1,709 customers respectively.</em></p><p><strong><em>2024:</em></strong><em> Clothing were the top-selling category with 1,711 customers.</em></p><p>Similarly, the preferred sales channels also varied significantly.</p><p><strong><em>2021:</em></strong><em> Mobile App was the most used sales channel with 1,279 customers.</em></p><p><strong><em>2022 and 2024:</em></strong><em> Social media platforms was the most used for these years with 1,253 and 1,299 customers.</em></p><p><strong><em>2023:</em></strong><em> Website was the most used sales channel with 1,284 customers.</em></p><p><strong>QUANTITY:</strong> The quantity sold varied significantly across product categories over the years.</p><p><strong><em>2021:</em></strong><em> Clothing and Electronics were the top product categories with 33.9% each of total sales.</em></p><p><strong><em>2022:</em></strong><em> Clothing and Home Appliances were the top categories with 33.6% each of total sales.</em></p><p><strong><em>2023:</em></strong><em> Home Appliances were the top category with 34.4% total sales.</em></p><p><strong><em>2024:</em></strong><em> Clothing were the top category with 34.4% total sales.</em></p><p>Similarly, the sales channel also varied across the years.</p><p><strong><em>2021: </em></strong><em>Mobile App was the most used channel with 26% of total sales.</em></p><p><strong><em>2022 and 2024:</em></strong><em> Social media platforms were the most used channel with 25.5% and 25% of total sales respectively.</em></p><p><strong><em>2023:</em></strong><em> Website was the most used channel with 25.4% of total sales.</em></p><p><strong>CONCLUSION</strong></p><p>The analysis of the Sales dataset from 2021 to 2024 reveals key patterns in revenue, profitability, customer behavior, and quantity sold across product categories and sales channels. Notably, 2024 marked a record-breaking year in both revenue and profit, largely driven by the Electronics category and Website channel. Customer preferences and purchasing behavior varied annually, with Clothing and Home Appliances consistently appearing among top-performing categories. Sales channels also showed fluctuating effectiveness, with Social Media, Website, and Mobile App platforms each having standout years.</p><p><strong>RECOMMENDATION</strong></p><p>1. Focus Investment on High-Performing Categories: Continue investing in high-performing categories like Electronics and Clothing, especially during peak months such as November, to further drive profitability.</p><p>2. Optimize the Website Sales Channel: Given its consistent effectiveness — especially in 2024 — enhancing the user experience and marketing efforts on the Website channel could lead to sustained growth.</p><p>3. Leverage Seasonal Sales Insights: With November shown as the top revenue-generating month, plan promotions and campaigns ahead of Q4 to maximize returns.</p><p>4. Monitor Shifting Customer Preferences: Regularly assess customer behavior to adapt to changing trends. For instance, the rise of Home Appliances in 2023 indicates a potential growth area.</p><p>5. Diversify and Strengthen Channel Strategies: As different years favored different sales channels, a balanced, omnichannel approach involving Social Media, Website, and Mobile App can capture a broader customer base.</p><p>6. Data-Driven Marketing: Use insights from customer trends to tailor marketing messages and product placements for each channel and category annually.</p><h3><strong>VISUALIZATION</strong></h3><p>This is the graphical representation of the analysis done on the sales dataset. It is an interactive dashboard. The overview of the dashboard is below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*P8_zNKbrCCoqAafw3Opp3A.png" /><figcaption>Graphical Representation of the Analysis on Sales Dataset</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26f555ccd884" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continued Exploration of SQL: Questions and Solutions]]></title>
            <link>https://medium.com/@zullyheart3/continued-exploration-of-sql-questions-and-solutions-883d26343348?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/883d26343348</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 15:44:29 GMT</pubDate>
            <atom:updated>2025-04-27T15:44:29.877Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>INTRODUCTION</strong></p><p>Structured Query Language is the language used to communicate with Database. SQL is a tool that brings data to life. It stores, manage, retrieve, manipulate, aggregate data and also table creation. Mastering SQL means gaining the power to ask questions of the data and get meaningful answers; it is not just learning the language.</p><p><strong>OVERVIEW OF THE DATASET</strong></p><p>The dataset contains four tables; Actors, Movies, Movies revenue and Directors.</p><ol><li>Actors Table: This table contains information about the actors including their first name, last name, gender, date of birth and actors id which uniquely identifies each row. It contains 147 rows of data.</li><li>Movies Table: This table contains information about the movies which include movie names, movie length, movie language, release date, age certificate, director id ( this is a column from another table, foreign key use to create relationship between the movies table and the directors table) and also the movie id which is the primary key of this table. It contains 53 rows of data.</li><li>Movie Revenues Table: This table contain the revenue generated from each movie. The columns are domestic takings, international takings, movie id (foreign key) and revenue id (primary key). It contains 53 rows of data.</li><li>Directors Table: This table contains information about the directors including their first name, last name, date of birth, nationality, movie id (foreign key) and the directors id (primary key). It contains 37 rows of data.</li></ol><p>Here, I’ll be sharing some KEY COMPONENT OF SQL questions along with their answers and explanation to help understand the results using a Movie dataset. Feel free to explore, comment or try them out.</p><p><strong>JOINS</strong></p><p>Joins are used to combine rows from two or more tables based on a related column between them. Common types include INNER JOIN, LEFT JOIN, RIGHT JOIN AND FULL OUTER JOIN.</p><ol><li>Retrieve all movies along with the full names of their directors</li></ol><pre>SELECT m.movie_name, <br>    d.last_name +&#39; &#39;+ d.first_name AS full_name<br>FROM Movies m<br>JOIN Directors d ON m.director_id = d.director_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*lhrmCC7iyHDpo4cuyKD5ww.png" /><figcaption>This query retrieves the full names of the directors and the movies they directed.</figcaption></figure><p>2. List each movie with its domestic and international takings</p><pre>SELECT m.movie_name, <br>    mr.domestic_takings, <br>    mr.international_takings<br>FROM Movies m<br>JOIN Movie_revenues mr ON m.movie_id = mr.movie_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*M8djT5VIwFeBJLJWE56GmA.png" /></figure><p>Each movie has its own domestic takings and international takings. Domestic takings meaning revenue generated locally (within its country) and International takings meaning revenue generated outside the country. Some of the rows are NULL, it could be that the movies didn’t go outside the country while the one that the domestic takings are NULL, it could be that the movie is yet to be released.</p><p>3. Get a list of actors and the movies they starred in</p><pre>SELECT <br>    a.first_name +&#39; &#39;+ a.last_name AS full_name,<br>    m.movie_name<br>FROM Actors a <br>JOIN Movies_actors ma ON a.actor_id = ma.actor_id<br>JOIN Movies m ON ma.movie_id = m.movie_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*nY3WaYVqIv0Z3gU76atcZw.png" /></figure><p>This query means that we should retrieve the actors and movies they starred/acted in. Lets not forget that there are several actors in a movie, that is why the movie name column has some movie names repeated. The query returns 181 rows.</p><p>4. Find all movies released along with their director’s nationality</p><pre>SELECT <br>    m.movie_name, d.nationality<br>FROM Movies m <br>JOIN Directors d ON m.director_id = d.director_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*AOmWM_dutmFNnr7bUAhvJw.png" /></figure><p>This query means we retrieve all movies and the country of the movie directors. Below shows the countries and the actors from there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*iC_VXZYjRXC1EAOMpLChfQ.png" /><figcaption>Actors per country</figcaption></figure><p>5. Show each movie, its revenue and the full name of the director</p><pre>SELECT <br>    m.movie_name,<br>    COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) AS revenue,<br>    d.last_name +&#39; &#39;+ d.first_name AS full_name<br>FROM Movies m<br>JOIN Movie_revenues mr ON mr.movie_id = m.movie_id<br>JOIN Directors d ON m.director_id = d.director_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*EzYzPB9KbCT7sA0b5-WAuA.png" /></figure><p>This query means to return the revenue of each movie and the director’s full name. COALESCE was used in the query because there are some movies without either domestic takings or international takings. In SQL, NULL + any_value = NULL; i.e, without the COALESCE, those movies would return NULL.</p><p>6. show movies with no revenue</p><pre>SELECT <br>    m.movie_name, <br>    mr.domestic_takings,<br>    mr.international_takings<br>FROM Movies m <br>LEFT JOIN Movie_revenues mr ON m.movie_id = mr.movie_id<br>WHERE <br>    mr.domestic_takings IS NULL<br>    AND mr.international_takings IS NULL;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*BA9DaY_zLhK2ehZDakHJUg.png" /></figure><p>This query returns the movies that have no revenue. This could be that the movies are yet to be released or missing data.</p><p><strong>COMMON TABLE EXPRESSION</strong></p><p>This is a temporary result set that can be reference within a SELECT, INSERT, UPDATE and DELETE statement. It improves readability and allow for more complex queries. CTE is like an extra table and it is used instead of subquery.</p><ol><li>Using CTE, calculate the average domestic and international takings, then list movies that earned above average in both</li></ol><pre>WITH Avg_takings AS (<br>    SELECT <br>        AVG(domestic_takings) AS avg_domestic,<br>        AVG(international_takings) AS avg_international<br>    FROM Movie_revenues <br>)<br>SELECT <br>    m.movie_name,<br>    mr.domestic_takings,<br>    mr.international_takings<br>FROM Movies m <br>JOIN Movie_revenues mr ON m.movie_id = mr.movie_id<br>JOIN Avg_takings a ON mr.domestic_takings &gt; a.avg_domestic<br>AND mr.international_takings &gt; a.avg_international;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*7a6l8ZSWnx0jAsKFD4rthw.png" /></figure><p>This query returns movies that earned above average in both domestic takings and international takings. Only 11 movies earned above both averages. The average of domestic takings is 119.16 while the average of international takings is 193.19. The averages were gotten by running the query after the WITH clause, which is the temporary table.</p><p>2. Create CTE to find the youngest director, then return all movies directed by the director</p><pre>WITH YoungestDirectors AS (<br>    SELECT <br>        director_id,<br>        last_name +&#39; &#39;+ first_name AS full_name,<br>        date_of_birth<br>    FROM Directors<br>    WHERE date_of_birth = (SELECT MAX(date_of_birth) FROM Directors)<br>)<br>SELECT <br>    m.movie_name,<br>    yd.full_name<br>FROM Movies m <br>JOIN YoungestDirectors yd ON m.director_id = yd.director_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*yFjgPkurgfJq7wtLJWBFfw.png" /></figure><p>This query returns the movie directed by the youngest director.</p><p>3. Use a CTE to list all actors born after 1990, and display their names and date of birth</p><pre>WITH ActorsAge AS (<br>    SELECT <br>        first_name,<br>        last_name,<br>        date_of_birth<br>    FROM Actors<br>    WHERE date_of_birth &gt; &#39;1990-12-31&#39;<br>)<br>SELECT <br>    first_name, <br>    last_name,<br>    date_of_birth<br>FROM ActorsAge;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*fpvc-gt1GXG6ez86PQRyAQ.png" /></figure><p>This query returns the name and date of birth of actors born after 1990.</p><p>4. Use a CTE to calculates the total revenue for each movie, then find the top 5 highest-grossing movies</p><pre>WITH TotalRevenue AS (<br>    SELECT <br>        m.movie_name,<br>        (mr.domestic_takings + mr.international_takings) AS Total_Revenue<br>    FROM Movie_revenues mr<br>    JOIN Movies m ON mr.movie_id = m.movie_id<br>)<br>SELECT TOP 5<br>    movie_name,<br>    Total_Revenue<br>FROM TotalRevenue<br>ORDER BY Total_Revenue DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*gTdFtJemEawHbphrDmlwIw.png" /></figure><p>This query returns the top 5 highest grossing movies.</p><p>5. Use a CTE to assign row number to each movie based on release date and display the most recent 3</p><pre>WITH MoviesRank AS (<br>    SELECT <br>        movie_name,<br>        release_date,<br>    ROW_NUMBER() OVER (ORDER BY release_date DESC) AS Row_num<br>    FROM Movies<br>)<br>SELECT TOP 3<br>    movie_name,<br>    release_date<br>FROM MoviesRank<br>ORDER BY release_date DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*VvTemDoNxMLb94YR1K3kzg.png" /></figure><p>This query returns the 3 recent movies after assigning row number to each movie based on released date.</p><p><strong>WINDOW FUNCTIONS</strong></p><p>They perform calculations across a set of rows related to the current row without collapsing the result into a single output like aggregate functions (SUM(), AVG(), etc). They can partition data into subsets similar to GROUP BY and rows can also be ordered within the partition. They are useful for ranking, comute running totals, moving averages, and percentages.</p><ol><li>Rank movies based on their total revenue from highest to lowest</li></ol><pre>SELECT <br>    movie_name,<br>    COALESCE(mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) AS Total_Revenue,<br>    RANK() OVER (ORDER BY (COALESCE(mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0)) DESC) AS MovieRevenue_Rank<br>FROM Movies m <br>JOIN Movie_revenues mr ON m.movie_id = mr.movie_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*zXtBaz63ljeX54UCXbFAew.png" /></figure><p>This query returns the rank of movies based on revenue generated. The Titanic movie is ranked 1 because it has the highest revenue.</p><p>2. For each director, rank their movies by release date</p><pre>SELECT <br>    d.last_name +&#39; &#39;+ d.first_name AS full_name,<br>    m.movie_name,<br>    m.release_date,<br>    RANK() OVER (PARTITION BY d.director_id ORDER BY m.release_date DESC) AS Movie_Rank<br>FROM Directors d <br>JOIN Movies m ON d.director_id = m.director_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*Rv105bJTupO7pksFRzGbmw.png" /></figure><p>This query returns the rank of movies based on released date for each director. Looking at the output/result, notice the movies were ranked based on released date by directors. For example, director Anderson Wes has released 3 movies so far and the movies were ranked according to the release date before moving to another director.</p><p>3. Use a window function to find the average revenue per movie across the dataset, and show it alongside each movie</p><pre>SELECT <br>    m.movie_name,<br>    COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) AS Total_revenue,<br>    AVG(COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0)) OVER () AS Avg_revenue<br>FROM Movie_revenues mr <br>JOIN Movies m ON mr.movie_id = m.movie_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*h3YuE2kYkHFdjtjkkoJjHg.png" /></figure><p>This query returns the avearge revenue per movie across the dataset. The average revenue are the same across all rows because of the window function OVER() used with the AVG() function and the window function has no partitioning. This can also help to see movies performing above or below the overall average revenue.</p><p>4. List all movies along with the difference between their reveue and the average revenue of all movies</p><pre>SELECT <br>    m.movie_name,<br>    COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) AS Total_revenue,<br>    COALESCE(mr.domestic_takings, 0) + COALESCE (mr.international_takings, 0) - <br>    AVG(COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0)) OVER () AS Revenue_diff<br>FROM Movie_revenues mr <br>JOIN Movies m ON mr.movie_id = m.movie_id<br>ORDER BY Revenue_diff DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*Vu2v6aZzZ1awVTLc_tyjFA.png" /></figure><p>This query returns the difference between the total revenue of each movie and the overall avearge revenue. 16 movies out of 53 movies are above the overall average revenue. Which means about 70% of the movies are below the overall average revenue.</p><p>5. For each language, rank movies by total takings</p><pre>SELECT <br>    m.movie_name,<br>    m.movie_lang,<br>    COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) AS Total_revenue,<br>    RANK() OVER(PARTITION BY m.movie_lang ORDER BY COALESCE (mr.domestic_takings, 0) + <br>    COALESCE (mr.international_takings, 0) DESC) AS MovieLang_Rank<br>FROM Movies m <br>JOIN Movie_revenues mr ON m.movie_id = mr.movie_id;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*EAm97QaLj7vfNPR3emf1Cw.png" /></figure><p>This query returns the rank of movies based on revenue generated for each movie language. Below is the percentage of revenue generated per movie language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*QwDEpOQUrR8rGZpslMvLCA.png" /><figcaption>Movie language per % of Revenue</figcaption></figure><p><strong>SUBQUERIES</strong></p><p>They are query inside another query. It allows to perfrom a query inside another query, helping to filter results more efficiently. The SUBQUERY ca be placed in the WHERE, FROM or SELECT clauses.</p><ol><li>Find actors who were born before the earliest movie release date</li></ol><pre>SELECT <br>    first_name, <br>    last_name,<br>    date_of_birth<br>FROM Actors<br>WHERE date_of_birth &lt; (SELECT MIN(release_date)<br>FROM Movies);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*f-9-ASfJYChnzbTK5fdwrQ.png" /></figure><p>This query returns the actors who were born before the first movie was released. The first movie release date was 1939–08–25. The output shows 15 actors were born before the first movie release date.</p><p>2. List all movies that have higher domestic takings than the average domestic takings</p><pre>SELECT <br>    movie_id,<br>    domestic_takings<br>FROM Movie_revenues<br>WHERE domestic_takings &gt; (SELECT AVG(domestic_takings) FROM Movie_revenues)<br>ORDER BY domestic_takings DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*KbRoQBWWwStT_XfSgovuRQ.png" /></figure><p>This query returns the domestic takings higher than the average domestic takings. The average domestic takings is 119.16 and there are 16 movies above the average domestic takings.</p><p>3. Retrieve the names of directors who have directed more than one movie</p><pre>SELECT <br>    first_name, <br>    last_name<br>FROM Directors d <br>WHERE director_id IN (<br>    SELECT director_id <br>    FROM Movies <br>    GROUP BY director_id <br>    HAVING COUNT(movie_id)&gt;1);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*Ej3MRo4oK0N0Rzkci3r5Yw.png" /></figure><p>This query returns the directors who have directed more than one movie.</p><p>4. Get movies that have the highest total revenue</p><pre>SELECT<br>    m.movie_name,<br>    (mr.domestic_takings + mr.international_takings) AS Total_revenue<br>FROM Movies m <br>JOIN Movie_revenues mr ON m.movie_id = mr.movie_id<br>WHERE (mr.domestic_takings + mr.international_takings) = (SELECT MAX(domestic_takings + international_takings) <br>    FROM Movie_revenues);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*0hBPbp7a-2JW5nxUyXGXTQ.png" /></figure><p>This query returns the movie with the highest total revenue.</p><p>5. Show all movies whose length is above the average movie length</p><pre>SELECT<br>    movie_name,<br>    movie_length<br>FROM Movies<br>WHERE movie_length &gt; (SELECT AVG(movie_length) FROM Movies)<br>ORDER BY movie_length DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*beODyLSlmQt4S4r7HF3BhQ.png" /></figure><p>This query returns the movies whose movie length is above the average movie length.</p><p><strong>CASE STATEMENT</strong></p><p>They are used to create conditional logic within queries. It allows to return specific values based on conditions.</p><ol><li>Categorize movies as ‘Short’, ‘Standard’, or ‘Long’ based on their length</li></ol><pre>SELECT <br>    movie_name,<br>    movie_length,<br>    CASE <br>        WHEN movie_length &lt; 100 THEN &#39;Short&#39;<br>        WHEN movie_length &lt; 130 THEN &#39;Standard&#39;<br>        ELSE &#39;Long&#39;<br>    END AS Movie_length_range<br>FROM Movies;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*kGGJU9Sp-0vnxiofqvkFDQ.png" /></figure><p>This query returns movie that are either in short movie length, Standard movie length and long movie length. Below is the percentage of each range for all movies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*ZaNj6FImpnRE56SZVThvNA.png" /></figure><p>2. Create a CASE column that classifies movies into ‘Old’(before 2000),’Modern’ (2000–2010) and ‘Recent’ (after 2010)</p><pre>SELECT <br>    movie_name,<br>    release_date,<br>    CASE <br>        WHEN release_date &lt; &#39;2000-01-01&#39; THEN &#39;Old&#39;<br>        WHEN release_date &lt; &#39;2010-01-01&#39; THEN &#39;Modern&#39;<br>        ELSE &#39;Recent&#39;<br>    END AS Movies_age<br>FROM Movies;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*eqQr9meEeLVmXG2SB3ZdgQ.png" /></figure><p>This query categorize movies based on released date. Old movies are 27 in numbers, Modern movies are 20 while Recent movies are 6 in numbers.</p><p>3. Use a CASE statement to assign a rating label: ‘Low’ (&lt;100), ‘Medium’ (100–800), ‘High’ (&gt;500) based on total revenue</p><pre>WITH RevenueRange AS (<br>    SELECT <br>        m.movie_name,<br>        mr.domestic_takings,<br>        mr.international_takings,<br>        COALESCE (mr.domestic_takings, 0) + <br>        COALESCE (mr.international_takings, 0) AS Total_revenue<br>    FROM Movie_revenues mr <br>    JOIN Movies m ON m.movie_id = mr.movie_id<br>)<br>SELECT <br>    movie_name,<br>    total_revenue,<br>    CASE <br>        WHEN Total_revenue &lt; 100 THEN &#39;Low&#39;<br>        WHEN Total_revenue BETWEEN 100 AND 800 THEN &#39;Medium&#39;<br>        ELSE &#39;High&#39;<br>    END AS Revenue_range<br>FROM RevenueRange;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*MTm0Z4SsgLTm6WfryH1eIw.png" /></figure><p>This query categorizes the movie revenue into ranges of Low, Medium and High.</p><p>The Low revenue range has 50.94%, the Medium has 43.40% while the High has 5.66%.</p><p>4. Label actors as ‘male’, ‘female’ or other based on the gender column</p><pre>SELECT <br>    first_name,<br>    last_name,<br>    gender,<br>    CASE<br>        WHEN gender = &#39;m&#39; THEN &#39;Male&#39;<br>        ELSE &#39;Female&#39;<br>    END AS GENDER<br>FROM Actors;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*_OFJwMdcPNl-wzJvrnwjOg.png" /></figure><p>This query categorize actors based on gender. 66.7% of the actors are Male and 33.3% are Females.</p><p>5. Use a CASE statement to flag movies as ‘Blockbuster’ if total revenue exceeds 1000, else ‘Regular’</p><pre>WITH RevenueRange AS (<br>    SELECT <br>        m.movie_name,<br>        mr.domestic_takings,<br>        mr.international_takings,<br>        COALESCE (mr.domestic_takings, 0) + <br>        COALESCE (mr.international_takings, 0) AS Total_revenue<br>    FROM Movie_revenues mr <br>    JOIN Movies m ON m.movie_id = mr.movie_id<br>)<br>SELECT<br>    movie_name,<br>    Total_revenue,<br>    CASE <br>        WHEN Total_revenue &gt; 1000 THEN &#39;Blockbuster&#39;<br>        ELSE &#39;Regular&#39;<br>    END AS Movie_flag<br>FROM RevenueRange;<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*xwgAyC23OvSG4WV9--SDFw.png" /></figure><p>This query flag movie as Blockbuster and Regular based on total revenue. Only one movie exceeds 1000 total revenue.</p><p><strong>CONCLUSIONS</strong></p><p>Through these SQL questions and answers, we’ve explored several essential components of SQL, including CASE statements, JOIN operations, WHERE clauses, Window Functions, CTEs and subqueries. Understanding these core concepts not only helps in writing efficient and optimized queries but also builds a strong foundation for working with relational databases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=883d26343348" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Modeling in Power BI]]></title>
            <link>https://medium.com/@zullyheart3/data-modeling-in-power-bi-1fdbfd536e9f?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fdbfd536e9f</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 22:02:05 GMT</pubDate>
            <atom:updated>2025-04-02T22:02:05.578Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>INTRODUCTION</strong></h3><p>Data modeling is the process of organizing and structuring data based on relationship for efficient performance and analysis. Relationships determine how the data in one table is connected to data in another.</p><p>Data modeling involves creating visual representations of the relationships between data structures, with information about the individual columns contained within those data structures.</p><p>There are two(2) tables in Data Modeling; FACT table and DIMENSION table.</p><p>FACT Table stores quantitative and measurable data. It contains numeric value and aggregation/calculation can be performed on it.</p><p>DIMENSION Table stores descriptive data and provide context for the data in fact tables. It is used to filter data by categories.</p><h3><strong>OBJECTIVE</strong></h3><p>The objective of this project is to design and implement a robust data model using Power BI, structuring the dataset into fact tables and dimension tables, to enable efficient data analysis, reporting, and decision-making.</p><p><strong>ABOUT THE DATASET</strong></p><p>This dataset is a quite complex dataset that contains 23 columns and 10,000 rows. This complex dataset was broken down into tables and a relationship was established between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eeWnN7tBqr6BF7oubgXIMQ.png" /><figcaption>Sales Dataset</figcaption></figure><p>After exploring the above dataset to understand each columns, the dataset was loaded to power query editor through power bi by navigating to the home tab, click on get data to select the dataset and transform data. This will load the Power query editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PA76InEEzzoRbb467bVMQ.png" /><figcaption>After loading into the Power Query Editor</figcaption></figure><p>Some of the columns datatype were changed to main data integrity and compatibility in all columns. The sales Id datatype was changed to text because Id columns are not meant for calculations and few other columns datatypes were changed as well.</p><p>After that, the dataset was duplicated into 6 dimension tables and each table has its own columns. To duplicate the dataset, right click on the dataset on the left hand side of the power query page and select duplicate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-AB901CL_fs0F1DnRekCw.png" /><figcaption>Image showing duplicate dataset</figcaption></figure><p>Each duplicate dataset were renamed to DimCustomer, DimEmployee, DimStore, DimProduct, DimSupplier and DimShipmode; columns were also selected for each dataset. The columns selected for each table were columns that have the table information. For example; the DimCustomer table contains 3 columns, the customer name, customer segment and customer country. After selecting the 3 columns, other columns were removed. This was done by navigating the home tab-choose columns-choose columns and a page appeared. All columns were unselected and only the required columns were selected. Same steps were taken for other tables. Primary key was also created for each table to help create relationship between the dimension tables and the fact table. The primary key was created by navigating the add column tab-index column-from 1. A new column was introduced containing the primary key and the column was renamed to a suitable name like CustomerID. The new column datatype was changed to text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxd44iSbXxT3utuUbHMebA.png" /><figcaption>image containing the dimension tables.</figcaption></figure><p>After the dimension tables creation, relationships were created between the fact table and the dimension tables by navigating the merge queries on the home tab. Merge queries-merge queries as new. The fact table and a select tab to select the first dimension table to merge will appear. A common column in the 2 tables were selected to create the relationship. Inner join kind was selected because we only want matching rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D416oUKm6ZFZLE9r5XzF8A.png" /><figcaption>Image showing how to create relationship between tables.</figcaption></figure><p>These steps were also used to create relationship between the fact table and other dimension tables using the common column. After the relationships are created, the query page was closed and applied to power bi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*awcTuuVsqTWCq-yBmTD4Ag.png" /><figcaption>After loading to Power BI (Table view)</figcaption></figure><p>On the model view page, relationship was created by dragging the primary key from the dimension table to the fact table. A page appeared which shows how the relationship is created. The cardinality (defines the relationship between tables in a data model, specifying how many rows in one table relate to rows in another table) is one to many relationship. It is a one to many relationship because a customer can have multiple orders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pr6u-niDZZ9YYhg86o1HnA.png" /><figcaption>Creating relationship between two tables.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3FZR3ODXEPbtssO2umvwQ.png" /><figcaption>Model view on Power BI</figcaption></figure><h3><strong>CONCLUSION</strong></h3><p>This project has demonstrated the power of Power BI in designing and implementing a robust data model that structures data into fact tables and dimension tables. The developed data model will enable efficient data analysis, reporting, and decision-making, providing valuable insights to stakeholders.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fdbfd536e9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ADVENTUREWORKS2019 DATASET ANALYSIS]]></title>
            <link>https://medium.com/@zullyheart3/adventureworks2019-dataset-analysis-d5386433d484?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5386433d484</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 09:05:53 GMT</pubDate>
            <atom:updated>2025-03-20T09:05:53.848Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>INTRODUCTION</strong></p><p>AdventureWorks simulates a fictitious multinational manufacturing company (Adventure Works Cycles) producing and distributing bicycles, parts and accessories. It is an online transaction processing version for transactional data and a data warehouse version for analytical purposes. It supports variety of scenarios including manufacturing, sales, purchasing, product management, contact management and human resources. The information in the database contains sales order, customers, products, promotions and sales territories.</p><p>The AdventureWorks databases have versions for different SQL Server compatibility levels, such as AdventureWorks2014, AdventureWorks2019, and AdventureWorks2022.</p><p><strong>OVERVIEW OF THE PROJECT</strong></p><p>The database consists of over 70 tables but only few tables were used for this project. The tables include;</p><p>· <strong>Sales.SalesOrderHeader:</strong> This table contains information about the products ordered including the ordered, order date, shipping date, payment, and also has some columns from other tables as a foreign key to as to be able to establish a relationship between them.</p><p>· <strong>Sales.SalesOrderDetail:</strong> This table also contains information about the products like the quantity/unit ordered, the amount, the discount on each product and also contains foreign keys to create relationship.</p><p>· <strong>Production.Product</strong>: This table contains the information about the products ordered. The name, id, color, size, weight, list price, and so on. It also contains some foreign keys to create relationship.</p><p>· <strong>Production.ProductCategory:</strong> This table contains the product category. There are four (4) categories, which are bikes category, components category, clothing category and accessories category. Each category is provided with a primary key.</p><p>· <strong>Production.ProductSubCategory:</strong> This table contains each product category subcategory. The 4 categories have subcategories. Subcategory is important for scalability, improved navigation and discovery, increased conversion rates and so on. The table has a foreign key which is productid, it helps to know which category the subcategories fall.</p><p>· <strong>Sales.SalesPerson:</strong> This table contains information of the sales representative including the business entityID, territoryID which is a foreign key in the table used to know the location of where the sales person is representing, commission, previous year sales and so on.</p><p>· <strong>Sales.SalesTerritory:</strong> This table contains the location of each branch of the organization. The organization is in 6 different countries (United State, Canada, France, Germany, Australia, and United Kingdom) and also the continent of the countries which are just 3 continents. The table also contains the sales amount of each country.</p><p>· <strong>Sales.Customer:</strong> This table contains customers information including their ID, account number and also foreign keys to link tables together.</p><p>· <strong>Person.Person:</strong> This table contains information about the customers, employees, sales person/rep, vendor, etc and also their first, middle and last name, email promotion (if they wish to receive mail or not), demography, etc.</p><p>The above are the tables used in carrying out this project.</p><p><strong>PROJECT TASKS AND QUESTIONS</strong></p><p>There are 20 analytical questions to be answered using T-SQL queries</p><p><strong>CUSTOMER BEHAVIOUR ANALYSIS</strong></p><ol><li>Retrieve the <strong>top 10 customers by total purchase amount</strong></li></ol><pre>SELECT TOP 10<br>    c.CustomerID, <br>    p.Firstname,<br>    p.Lastname,<br>    SUM(TotalDue) AS TotalPurchase<br>FROM sales.SalesOrderHeader soh <br>JOIN Sales.Customer c ON soh.CustomerID = c.CustomerID<br>JOIN Person.Person p ON c.PersonID = p.BusinessEntityID<br>GROUP BY c.CustomerID, p.FirstName, p.LastName<br>ORDER BY TotalPurchase DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*BXF3cyH54wXsiuVzZgPEjg.png" /></figure><p>The visual above shows the top 10 performing customers by total purchase. Roger Harl made the most purchase with a total of $989,184 while Stacy Cereghino made the least purchase of $820,383.</p><p>2. Find customers who have made <strong>repeat purchases of the same product on different orders.</strong></p><pre>SELECT<br>    soh.CustomerID, <br>    sod.ProductID,<br>    COUNT(DISTINCT sod.SalesOrderID) AS repeat_orders<br>FROM Sales.SalesOrderHeader soh  <br>JOIN Sales.SalesOrderDetail sod ON soh.SalesOrderID = sod.SalesOrderID<br>GROUP BY soh.CustomerID, sod.ProductID<br>HAVING COUNT(DISTINCT sod.SalesOrderID) &gt; 1     -- filtering for customers who have made more than 1 order of same product<br>ORDER BY repeat_orders DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*eKa_aLb2c7OL_LGOOLL2GQ.png" /><figcaption>This query returns 16,122 rows where the customerID 11566 has 16 repeat purchases of the same product on different orders.</figcaption></figure><p>3. List customers whose <strong>spending has dropped by more than 30% compared to the previous year.</strong></p><pre>WITH yearly_spending AS (<br>    SELECT<br>        soh.CustomerID, <br>        YEAR(soh.OrderDate) AS order_year,<br>        SUM(soh.TotalDue) AS total_spent<br>    FROM Sales.SalesOrderHeader soh <br>    JOIN Sales.SalesOrderDetail sod ON soh.SalesOrderID = sod.SalesOrderID <br>    GROUP BY soh.CustomerID, YEAR(soh.OrderDate)<br>),<br>YearComparison AS (<br>    SELECT<br>        CustomerID,<br>        order_year,<br>        total_spent,<br>        LAG(total_spent) OVER (PARTITION BY CustomerID ORDER BY order_year) AS previous_spending<br>    FROM yearly_spending<br>)<br>SELECT <br>    soh.CustomerID,<br>    yc.order_year AS current_year,<br>    yc.previous_spending,<br>    yc.total_spent AS current_spending,<br>    ((yc.previous_spending - yc.total_spent) / yc.previous_spending) * 100 AS spending_drop<br>FROM YearComparison yc <br>JOIN Sales.SalesOrderHeader soh ON yc.CustomerID = soh.CustomerID<br>WHERE yc.previous_spending IS NOT NULL<br>AND ((yc.previous_spending - yc.total_spent) / yc.previous_spending) * 100 &gt; 30<br>GROUP BY soh.CustomerID, yc.order_year, yc.previous_spending, yc.total_spent<br>ORDER BY spending_drop;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*sBN2ud_opyZlHSf0FB9ckg.png" /><figcaption>This query returns 1,919 rows of customers whose spending habit has dropped by more than 30% compared to the previous year.</figcaption></figure><p>4. Identify the <strong>average number of days</strong> between repeat purchases for each customer.</p><pre>WITH PurchaseSpace AS (<br>    SELECT <br>        CustomerID, OrderDate,<br>        LAG(OrderDate) OVER (PARTITION BY CustomerID ORDER BY OrderDate) AS previous_date<br>    FROM Sales.SalesOrderHeader<br>),<br>DateDifference AS (<br>    SELECT<br>        CustomerID,<br>        DATEDIFF(DAY, previous_date, OrderDate) AS days_different<br>    FROM PurchaseSpace<br>    WHERE previous_date IS NOT NULL   -- excluding customers with only one purchase<br>)<br>SELECT<br>    soh.CustomerID,<br>    AVG(dd.days_different) AS avg_daysdiff<br>FROM  DateDifference dd<br>JOIN Sales.SalesOrderHeader soh ON dd.CustomerID = soh.CustomerID<br>GROUP BY soh.CustomerID<br>ORDER BY avg_daysdiff DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*WDXKBvPllWnvMiDJ2iO1UA.png" /><figcaption>This query returns 7,470 rows of the average number of days between repeat purchases for each customer. With 1089 as the highest average number.</figcaption></figure><p>5. Find the <strong>top 5 most common product categories purchased</strong> by customers.</p><pre>SELECT TOP 5<br>    pc.ProductCategoryID,<br>    pc.Name,<br>    SUM(sod.OrderQty) AS num_of_purchases<br>FROM Sales.SalesOrderDetail sod <br>JOIN Production.Product pp ON sod.ProductID = pp.ProductID<br>JOIN Production.ProductSubcategory psc ON pp.ProductSubcategoryID = psc.ProductSubcategoryID<br>JOIN Production.ProductCategory pc ON psc.ProductCategoryID = pc.ProductCategoryID <br>GROUP BY pc.Name, pc.ProductCategoryID<br>ORDER BY num_of_purchases DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*nYVB-ZCPjGU6fbjUurZPPQ.png" /><figcaption>The top most purchased product category is the bikes category with total of 90,268 while the least product category is the components with total of 49,044.</figcaption></figure><p><strong>SALES PERFORMANCE ANALYSIS</strong></p><p>6. Identify the <strong>most profitable products</strong> in terms of total revenue.</p><pre>SELECT TOP 5<br>    pp.ProductID, pp.Name,<br>    SUM(sod.LineTotal) AS total_revenue<br>FROM Production.Product pp<br>JOIN Sales.SalesOrderDetail sod ON pp.ProductID = sod.ProductID<br>GROUP BY pp.ProductID, pp.Name<br>ORDER BY total_revenue DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*ZdCh4vwh2BrmwkqfVrmSWA.png" /><figcaption>These are top 5 most profitable products. Mountain-200 Black, 38 generates over $4.4M in revenue. The mountain bikes generate the highest revenue compared to other products.</figcaption></figure><p>7. Determine the <strong>top 5 sales representative</strong> based on the total revenue generated.</p><pre>SELECT TOP 5<br>    sp.BusinessEntityID,<br>    pp.FirstName, pp.LastName,<br>    SUM(TotalDue) AS total_revenue<br>FROM Sales.SalesOrderHeader soh <br>JOIN Sales.SalesPerson sp ON soh.SalesPersonID = sp.BusinessEntityID<br>JOIN Person.Person pp ON sp.BusinessEntityID = pp.BusinessEntityID<br>GROUP BY sp.BusinessEntityID, pp.FirstName, pp.LastName<br>ORDER BY total_revenue DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*XFcIigFmfFFKjzSU5sBwXA.png" /><figcaption>These are the top 5 sales representative based on revenue generated. The sales representative with the highest revenue generated is Linda Mitchell with total of $11.7M while Tsvi Reiter is the least among the 5 representative with a revenue of $8.1M.</figcaption></figure><p>8. Calculate the <strong>year-over-year sales growth rate.</strong></p><pre>WITH YearlySales AS (<br>    SELECT <br>        YEAR(OrderDate) AS year_sales,<br>        SUM(TotalDue) AS total_revenue,<br>        LAG(SUM(TotalDue)) OVER (ORDER BY YEAR(OrderDate)) AS previous_revenue<br>    FROM Sales.SalesOrderHeader<br>    GROUP BY YEAR(OrderDate)<br>)<br>SELECT <br>    year_sales, total_revenue,<br>    previous_revenue,<br>    (total_revenue - previous_revenue) * 100 / NULLIF(previous_revenue, 0) AS YOY_diff<br>FROM YearlySales<br>WHERE previous_revenue IS NOT NULL<br>GROUP BY year_sales, total_revenue, previous_revenue<br>ORDER BY YOY_diff DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*2DThcUZOKV4g9hgSdmqXXw.png" /><figcaption>The table above shows that in 2012, there was an increase of 166.2% increase from the previous year (2011). The revenue moved from $14.2M to $37.7M. Also, in 2013, the revenue moved from $37.7M to approximately $49M which is about 30% increment. There was a drop in revenue between 2013 to 2014. The revenue dropped from $49M to about $22.4M. This is -54% drop in the revenue.</figcaption></figure><p>9. Identify the <strong>top 5 regions</strong> where AdventureWorks generates the most revenue.</p><pre>SELECT TOP 5<br>    st.Name,<br>    st.CountryRegionCode,<br>    SUM(TotalDue) AS Total_revenue<br>FROM Sales.SalesTerritory st <br>JOIN Sales.SalesOrderHeader soh ON st.TerritoryID = soh.TerritoryID<br>GROUP BY st.Name, st.CountryRegionCode<br>ORDER BY Total_revenue DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*3jHJdqi1acK85y3VIDxgZQ.png" /><figcaption>The above visual shows that the southwest region generates more revenue with total of $27.2M. Canada and Northwest regions generate almost same revenue with $300k difference. The central region has the least revenue with total of $8.9M, sales must be very low in this region.</figcaption></figure><p><strong>PRODUCT AND INVENTORY INSIGHTS</strong></p><p>10. Find <strong>products frequently purchased together.</strong></p><pre>SELECT <br>    pp1.Name AS Product_1,<br>    pp2.Name AS Product_2,<br>    COUNT(*) AS Frequency   <br>FROM Sales.SalesOrderDetail sod1<br>JOIN Sales.SalesOrderDetail sod2 <br>    ON sod1.SalesOrderID = sod2.SalesOrderID<br>    AND sod1.ProductID &lt; sod2.ProductID  --- avoid duplicate pairs<br>JOIN Production.Product pp1 ON sod1.ProductID = pp1.ProductID<br>JOIN Production.Product pp2 ON sod2.ProductID = pp2.ProductID<br>GROUP BY pp1.Name, pp2.Name<br>ORDER BY Frequency DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*uo_31C_eQnqZ6m2ynp4o_g.png" /><figcaption>The above table returns 11,430 rows. It shows that the top frequent products purchased together are water bottle and cage. The cage is either mountain cage or road cage. This means that whenever customers purchase water bottle, a cage is usually purchased together so as to put the water bottle in the cage while riding the bikes. Another frequent product purchased together are logo cap and jersey. This means the customers wants to have matching cap and jersey.</figcaption></figure><p>11. Retrieve products that have <strong>never been sold.</strong></p><pre>SELECT <br>    pp.ProductID, pp.Name<br>FROM Production.Product pp<br>LEFT JOIN Sales.SalesOrderDetail sod ON pp.ProductID = sod.ProductID<br>WHERE sod.ProductID IS NULL;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*1743TLsohgMNrttyKEmU2A.png" /><figcaption>The query returns 238 rows. It means 238 products have never been sold.</figcaption></figure><p>12. Find the <strong>best-selling product in each category.</strong></p><pre>WITH ProductSales AS (<br>    SELECT <br>        pp.Name AS product_name, <br>        pc.Name AS product_category,<br>        SUM(sod.OrderQty) AS quantity_sold,<br>        RANK() OVER (PARTITION BY pc.Name ORDER BY SUM(sod.OrderQty) DESC) AS sales_rank<br>    FROM Sales.SalesOrderDetail sod  <br>    JOIN Production.Product pp ON sod.ProductID = pp.ProductID<br>    JOIN Production.ProductSubcategory psc ON pp.ProductSubcategoryID = psc.ProductSubcategoryID<br>    JOIN Production.ProductCategory pc ON psc.ProductCategoryID = pc.ProductCategoryID<br>    GROUP BY pp.Name, pc.Name<br>)<br>SELECT <br>    product_name,<br>    product_category,<br>    quantity_sold<br>FROM ProductSales<br>WHERE sales_rank =1<br>ORDER BY quantity_sold DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*38MakfqRar_J1PgN95_INg.png" /><figcaption>The table above shows the best-selling products of each category. In the clothing category, the best-selling product is the AWC Logo Cap with 8311 quantities sold. The accessories category has water bottle — 30 oz with 6815 quantities sold. The bikes category has Mountain-200 black, 38 with 2977 quantities sold while the components category has LL Road Frame — black, 52 with 1581 quantities sold.</figcaption></figure><p>13. Identify the <strong>most returned products</strong> based on order cancellation.</p><pre>SELECT<br>    pp.Name,<br>    COUNT(soh.[Status]) AS nums_returned<br>FROM Sales.SalesOrderDetail sod <br>JOIN Sales.SalesOrderHeader soh ON sod.SalesOrderID = soh.SalesOrderID<br>JOIN Production.Product pp ON sod.ProductID = pp.ProductID<br>WHERE soh.[Status] = 6  --- 6 represent cancellation<br>GROUP BY pp.Name;<br>This query didn’t return any reuslt which means no product was returned so far. <br>14. Find products with the highest order quantities but lowest total revenue<br>WITH OrderQuantity AS (<br>    SELECT <br>        pp.Name AS product_name,<br>        SUM(sod.OrderQty) AS total_quantity,<br>        SUM(TotalDue) AS total_revenue,<br>        DENSE_RANK() OVER (ORDER BY SUM(sod.OrderQty) DESC) AS Qty_rank,<br>        DENSE_RANK() OVER (ORDER BY SUM(TotalDue) ASC) AS Revenue_rank<br>    FROM Production.Product pp<br>    JOIN Sales.SalesOrderDetail sod ON pp.ProductID = sod.ProductID<br>    JOIN Sales.SalesOrderHeader soh ON sod.SalesOrderID = soh.SalesOrderID<br>    GROUP BY pp.Name<br>)<br>SELECT <br>    product_name<br>FROM OrderQuantity<br>WHERE Qty_rank &lt;= 100 AND Revenue_rank &lt;= 100<br>ORDER BY Qty_rank, Revenue_rank;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*cocc1xdmi1YqvX0JYB9HlA.png" /><figcaption>This query returns 13 rows showing that the 13 products have the highest order quantities in their category but generate the lowest revenue.</figcaption></figure><p><strong>ADVANCED BUSINESS INSIGHTS</strong></p><p>15. Calculate the <strong>monthly sales growth rate</strong> using a window function.</p><pre>WITH MonthlySales AS (<br>    SELECT <br>        DATEPART(MONTH, OrderDate) AS sales_month,<br>        SUM(TotalDue) AS month_revenue<br>    FROM Sales.SalesOrderHeader<br>    GROUP BY DATEPART(MONTH, OrderDate)<br>)<br>SELECT <br>    sales_month,<br>    month_revenue,<br>    LAG(month_revenue) OVER (ORDER BY sales_month) AS prev_mon_rev,<br>    (month_revenue - LAG(month_revenue) OVER (ORDER BY sales_month)) * 100 /<br>    NULLIF (LAG(month_revenue) OVER (ORDER BY sales_month),0) AS monthly_sales_growth<br>FROM MonthlySales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*xOUZr7z0HP617GlNsL216g.png" /><figcaption>The visual above shows the monthly trend/growth of sales revenue. Here, it is observed that the month of March has the highest growth in sales with a revenue of about $15.3M. While the month of February has the highest decline in sales with a revenue of about $5.7M.</figcaption></figure><p>17. Identify customers who <strong>purchased the same products multiple times</strong> in different orders.</p><pre>WITH CustomerProducts AS (<br>    SELECT <br>        pp.ProductID,<br>        pp.Name AS product_name,<br>        soh.CustomerID AS customer_id,<br>        COUNT (DISTINCT sod.SalesOrderID) AS order_count<br>    FROM Sales.SalesOrderHeader soh <br>    JOIN Sales.SalesOrderDetail sod ON soh.SalesOrderID = sod.SalesOrderID<br>    JOIN Production.Product pp ON sod.ProductID = pp.ProductID<br>    GROUP BY pp.ProductID, pp.Name, soh.CustomerID<br>)<br>SELECT <br>    customer_id, product_name<br>FROM CustomerProducts <br>WHERE order_count &gt; 1<br>GROUP BY customer_id,product_name<br>ORDER BY customer_id, product_name;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*BlVdV_usMXhfYaSgDB06Ow.png" /><figcaption>The query returns 16,122 rows. The table contains duplicate customerID because it shows that they purchase the same products multiple times in different orders/date.</figcaption></figure><p>18. Compute a <strong>3 month moving average revenue per sales representative.</strong></p><pre>SELECT <br>    BusinessEntityID,<br>    OrderDate AS monthly_sales,<br>    SUM(TotalDue) AS monthly_revenue,<br>    AVG(SUM(TotalDue)) OVER (PARTITION BY BusinessEntityID ORDER BY OrderDate<br>    ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS moving_avg<br>FROM Sales.SalesPerson sp <br>JOIN Sales.SalesOrderHeader sod ON sp.BusinessEntityID = sod.SalesPersonID<br>GROUP BY BusinessEntityID, OrderDate<br>ORDER BY BusinessEntityID, monthly_sales;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xyQoeY2KhMDwfl2YJI9nYw.png" /><figcaption>The query returns 468 rows of 3-month moving average for each sales representative.</figcaption></figure><p>19. Find <strong>frequently purchased product pairs</strong> using self join.</p><pre>WITH FrequentlyPurchased AS (<br>    SELECT <br>    sod1.ProductID AS Product1,<br>    sod2.ProductID AS Product2,<br>    COUNT(*) AS Frequency   <br>FROM Sales.SalesOrderDetail sod1<br>JOIN Sales.SalesOrderDetail sod2 <br>    ON sod1.SalesOrderID = sod2.SalesOrderID<br>    AND sod1.ProductID &lt; sod2.ProductID<br>GROUP BY sod1.ProductID, sod2.ProductID<br>)<br>SELECT  TOP 50<br>    pp1.Name AS Product1,<br>    pp2.Name AS Product2,<br>    Frequency   <br>FROM FrequentlyPurchased fp<br>JOIN Production.Product pp1 ON fp.Product1 = pp1.ProductID<br>JOIN Production.Product pp2 ON fp.Product2 = pp2.ProductID<br>ORDER BY Frequency DESC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ylyeV1uei18px9jlSssCDg.png" /><figcaption>The table shows product pairs with bottle water and bottle water cage been the top 2 with over 1500 quantities sold. Helmet and jersey are also a very good pairs. Helmets and gloves also have high frequently pairs product.</figcaption></figure><p>20. Detect customers whose <strong>spending has declined significantly over time.</strong></p><pre>WITH MonthlySpending AS (<br>    SELECT <br>        CustomerID,<br>        OrderDate AS monthly_order,<br>        SUM(TotalDue) AS monthly_revenue<br>    FROM Sales.SalesOrderHeader <br>    GROUP BY CustomerID, OrderDate<br>),<br>SpendingDecline AS (<br>    SELECT  <br>        CustomerID,<br>        monthly_revenue,<br>        LAG(monthly_revenue) OVER (PARTITION BY CustomerID ORDER BY monthly_order) AS prev_mon_rev,<br>        ((monthly_revenue - LAG(monthly_revenue) OVER (PARTITION BY CustomerID ORDER BY monthly_order)) /<br>        NULLIF (LAG(monthly_revenue) OVER (PARTITION BY CustomerID ORDER BY monthly_order), 0) * 100) AS spendingchange,<br>        ROW_NUMBER() OVER (PARTITION BY CustomerID ORDER BY monthly_order DESC) AS rn <br>    FROM MonthlySpending<br>    GROUP BY CustomerID, monthly_revenue, monthly_order<br>)<br>SELECT  <br>    CustomerID,<br>    monthly_revenue,<br>    prev_mon_rev,<br>    spendingchange<br>FROM SpendingDecline<br>WHERE spendingchange &lt; prev_mon_rev AND rn = 1<br>ORDER BY CustomerID;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5cb6V-QsmA6TAnCh7uLcQQ.png" /><figcaption>This query returns 6,722 rows of table containing customers whose spending has declined significantly over time. CustomerID 11000 spending incresed by 7.04% while the customerID 11001 spending declined by -75.66%.</figcaption></figure><p><strong>RECOMMENDATION</strong></p><p>· For the products with highest order quantities but lowest revenue, it is recommended that multiple units of the products should be sold at a slightly discounted price and also upselling by offering related products. Partnership with wholesalers and retailers for bulk distribution will also help.</p><p>· For the regions which have lowest revenue generation, it is recommended that distribution channel should be expanded, low cost digital payment option should as well be introduced and also advertisement should be prioritized in those regions. Affordability and accessibility should be focused on. While the regions that generate high revenue, they should maximize their profits by introducing premium product versions, implement subscription and membership models with discounts and also optimize for fast delivery.</p><p>· For the monthly trend of revenue, revenue should be maximized during peak seasons and sustain sales during off-peak seasons. Analysis should be done to know the peak and off-peak seasons. To maximize revenue during peak season, increase inventory levels to meet high demand, offer premium packages, invest in marketing and also expand sales channels. To sustain sales in off-peak seasons, discounts should be offer, diversify to regions where demand is still high, and also keep customers engaged.</p><p>· For customers who purchased same products multiple times, Bulk purchases should be encourage with discounts, create a seamless reordering process and as well reward customer’s loyalty.</p><p>· For the sales persons that have generated high revenue, they should be encourage to do better and as well compensate for a job well done. It will boost their morale to keep engaging the customers and as well create more beautiful relationships.</p><p>· For products that have never been sold, it is recommended that product visibility and marketing should be done, adjust price and offers if possible and also consider liquidation or pivoting.</p><p><strong>CONCLUSION</strong></p><p>The analysis of the AdventureWorks2019 dataset provided valuable insights into sales trend, product popularity, salesperson performance and territory dynamics. By leveraging these findings, AdventureWorks can make informed decision to drive growth, improve sales performance and optimize product development.</p><p>This project was carried out on SQL server Azure data studio to analyze the data, and Microsoft Excel for visualization.</p><p><a href="https://medium.com/u/82b0240c74c6">Ejike Uchenna Splendor</a> Thanks boss</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5386433d484" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CUSTOMER SHOPPING BEHAVIOUR]]></title>
            <link>https://medium.com/@zullyheart3/customer-shopping-behaviour-914888c6f243?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/914888c6f243</guid>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Tue, 18 Feb 2025 14:05:13 GMT</pubDate>
            <atom:updated>2025-02-18T14:05:13.560Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>INTRODUCTION</strong></p><p>The study of customer shopping behavior, also referred to as consumer buying behavior, examines the complex series of actions and decisions that consumers undertake when acquiring goods or services. This comprehensive process begins with the recognition of a need, proceeds through the evaluation of available options, culminates in the act of purchase, and extends to post-purchase assessments. Understanding customer shopping behavior is essential for businesses, as it enables them to develop effective marketing strategies and create products that cater to the diverse needs and desires of their target audience. A multitude of factors, including personal preferences, motivations, social influences, and cultural context, converge to shape buying decisions, making it crucial for businesses to consider these elements in order to successfully connect with their customers and drive long-term growth.</p><p><strong>KEY POINTS ABOUT CUSTOMER SHOPPING BEHAVIOR</strong></p><ul><li><strong>Decision-making process:</strong></li></ul><p>This includes identifying a need, searching for information about potential products, comparing alternatives, making a purchase decision, and assessing satisfaction after buying.</p><ul><li><strong>Influencing factors:</strong></li><li><strong>Personal factors:</strong> Demographics (age, income), lifestyle, personality, values</li><li><strong>Psychological factors:</strong> Perception, motivation, learning, attitudes</li><li><strong>Social factors:</strong> Family, friends, reference groups, social class</li><li><strong>Cultural factors:</strong> Traditions, beliefs, norms</li><li><strong>Situational factors:</strong> Shopping environment, time pressure, mood</li></ul><p><strong>IMPORTANCE OF STUDYING CUSTOMER SHOPPING BEHAVIOR</strong></p><ul><li><strong>Developing targeted marketing strategies:</strong></li></ul><p>By understanding customer motivations and decision-making processes, businesses can create campaigns that resonate with specific target audiences.</p><ul><li><strong>Product design and improvement:</strong></li></ul><p>Insights into customer needs and preferences can guide product development and feature enhancements.</p><ul><li><strong>Pricing optimization:</strong></li></ul><p>Understanding price sensitivity helps businesses set competitive prices.</p><ul><li><strong>Customer retention and loyalty:</strong></li></ul><p>By addressing customer concerns and providing positive post-purchase experiences, businesses can foster loyalty.</p><p><strong>OVERVIEW OF THE DATASET</strong></p><p>The customer shopping data was gotten from Splendor Analytics. It contains 99,457 rows and 10 columns. The columns contain Invoice number, Customer ID, Age, Gender, Product quantities, Price, Category, Shopping mall, Payment method, and Dates. The shopping mall contains 10 different malls, Payment methods are Cash, Credit card and Debit card, while there are 8 different categories of products.</p><p>This article will explore how Microsoft excel can be used to analyze dataset to gain insights and help to make meaning decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*nS6FWASn1vb2TQQnaGuJBA.png" /><figcaption>Overview of the dataset</figcaption></figure><p>Before carrying out any analysis or exploring a dataset, it is recommended to always put the data in a table by doing Ctrl T, it makes it easy and efficient. Whilst exploring the dataset, it was considered to add the age group column and amount column. The age group column was added to be able to categories and analysis the age group of the customers and the Amount column was added to be able to know the amount of products purchased by each customer. The Age was grouped into four groups by using the IFS function in excel. The IFS function helps us to check if one or more conditions are met. It can be used to meet multiple conditions at a time. It is an alternatiove to nested IF. Age less than or equal to 25 were classified as Teenagers, age less than or equal to 35 were classified as Adult, age less than or equal to 50 were classified as Elder and greater than 50 were Old.</p><p>The Amount column was gotten by multiplying the Quantity column by the Price column.</p><p>The dataset contains 39,975 males and 59,482 females.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*Ser3el1d_0_9tArZlTt_PQ.png" /><figcaption>Dataset in a Table format</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*y5oBXsmUg-erxJHtruiFHw.png" /><figcaption>Dataset showing age group formula</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*ZXfDfqG0G1fGJAMJy98IKA.png" /><figcaption>Dataset showing amount formula</figcaption></figure><p><strong>DESCRIPTIVE STATISTICS</strong></p><p>A desrciptive/summary statistics were performed on the Age, Quantity and Amount column.</p><p>MEAN: it shows the avaerage age of the customers, the average quantity of product purchased and average amount spent on products.</p><p>MEDIAN: It shows the median age of the customers, meaning half of the customers are below the average age and half are above the average age. Same goes to the Quantity and Amount.</p><p>MODE: This is the most frequently reoccurring age, amount and quantity.</p><p>RANGE: This shows the minimun and maximum age, quantity and amount.</p><p>STANDARD DEVIATION: The shows the amount of variation of the column. It indicates how spread out the values are areound the mean.</p><p>VARIANCE: It quantifies the dispersion of values within the dataset.</p><p>SKEWNESS: It shows how asymmeric the values are distributed. A distribution of skewness &lt; 0.5 means nearly symmetrical distribution.</p><p>CONFIDENCE INTERVAL: It shows the reliability of an estimate and it gives an indication of the amount of uncertainty associated with the estimate.</p><p>COUNT: It shows the total number of rows in the dataset.</p><p>The descriptive statistics was carried out using the Data Analysis command under the data tab in Microsoft excel. The column to be performed the descriptive statistics on was highlighted, then the data analysis command was navigated. There was a dropdown list of different statistical method tools and the descriptive statistics was clicked on. The input range was put which is the column descriptive analysis was to be performed, the output range is where the result would be, the summary statistics and confidence interval were clicked, the OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2Q2XSqS_1S8kDD14IsuXw.png" /><figcaption>How to get descriptive analysis function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*Y9vjZEEk4RLzQx3N5wmNWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*7Hd1FkyBSd_iz8eA1bTBOQ.png" /><figcaption>Summary Statistics page</figcaption></figure><p><strong>UNCOVERING INSIGHTS USING PIVOT TABLE</strong></p><p>Pivot Table in Excel is a powerful tool used to summarize, analyze and present data in a structured format to gain insights from a large dataset without manually sorting the data.</p><p><strong>AGE GROUP PER GENDER;</strong> The age group was grouped by gender to know which category purchased more products. It was observed that in the female gender, the OLD age group with a total of 21,611 purchased more products than other age group. While for the male gender, the OLD age group with a total of 14,490 purchased more products than the other age group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*fgqL523Y6wYtsMYse1yylw.png" /><figcaption>Age group per Gender</figcaption></figure><p><strong>CATEGORY BY GENDER;</strong> There are 7 categories of products and it was grouped by gender to know the performance of each gender per category. It was observed for both gender that the CLOTHING category came first with the total number of 20,652 for female and 13,835 for male, while COSMETICS has total number of 9,070 for female and 6,027 for male, followed by other categories.</p><p><strong>MOST POPULAR CATEGORY</strong>; The most popular categories are in the following order: CLOTHING, COSMETICS, FOOD&amp;BEVERAGE, TOYS, etc.</p><p><strong>AMOUNT SPENT PER AGE GROUP;</strong> The age group with most money spent is the OLD age group with the total amount of $91,308,132, Elder with amount of $74,199,731. Followed by Adult and Teenager.</p><p><strong>MOST USED PAYMENT METHOD;</strong> This shows the method customers use in making payment of purchases. The most used method is CASH with a total number of 44,447; follows by credit card and debit card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*e7lmhVuAE8GtU_DAh36xtg.png" /></figure><p><strong>SHOPPING MALL PER SALES;</strong> This shows the total amount generated by the 10 different shopping malls from the category of products. The shopping mall with the most amount generated is the MALL OF ISTANBUL with $50,872,481.68, the next shopping mall is KANYON with $50,554,231.10. Follow by other malls.</p><p><strong>SHOPPING MALL PER CUSTOMER;</strong> This shows the total numbers of customers that purchased products from each shopping mall. The shopping mall with most customers is the MALL OF ISTANBUL with total number of 19,943, KANYON with 19,823. Follow by other malls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8jSxr4ySW5qS9W_YahfoEw.png" /></figure><p><strong>SALES PER QUARTER OF EACH YEAR;</strong> This shows the difference in sales amount within the quarters of each year. The values show that there was no much difference in the quarters of each year, with less than $1,000,000 between 2 years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*Tv2YkAOZrLQNno9Vwk1RjA.png" /></figure><p><strong>RECOMMENDATION BASED ON SUMMARY STATISTICS</strong></p><p>1. The average customer age is 43years, with a median of 43 and mode of 37, and the age distribution is relatively normal with a small skewness of 0.009021. Since the majority of the customers are middle-aged, marketing campaigns should target the middle-aged and focus on their preferences.</p><p>2. The average quantity purchased per transaction is 3 units with a minimu of 1 and maximum of 5. Since the mode is 3, most customers tend to buy 3 items per transaction. It is recommended that discount should be considered on bulk purchases to increase average quantity per sale.</p><p>3. The average amount spent per transaction is $2,528.79, but the median is much lower at $600.17, indicating a highly skewed distribution (2.87). The standard deviation is very high (4,222.476) meaning there are significant variationsin spending habits. There is much difference between the range which means some customers spend a lot while others spend very little. It is recommended that customers that spent high should be identified and introduce a loyalty or VIP program to retain them.</p><p>4. Shopping malls with low sales should analyze the best performing malls and replicate their strategies. Conduct a comparative analysis to understand trends and apply bes practices. Staffs should be trained to improve customers interaction. Location may also be a huge factors for low sales, social media ads, local billboards and influencermarketing can be used to attract customers. Customers prefernces should also be analyzed and stock best selling products in all locations.</p><p><strong>CONCLUSION</strong></p><p>All shopping malls should invest in better marketing campaign especially the malls that are not so doing well. Discounts should also be considered on some products aside the discount on bulk purchases.</p><p>Sales data should be used to identify peak shopping hours and optimize staff scheduling. Survey should also be considered and customers feedback to understand pain points.</p><p><a href="https://medium.com/u/82b0240c74c6">Ejike Uchenna Splendor</a> Thank you for the opportunity sir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=914888c6f243" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FIFA21 Dataset Cleaning]]></title>
            <link>https://medium.com/@zullyheart3/fifa21-dataset-cleaning-e8f2e66b5fa2?source=rss-f87d2c11b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8f2e66b5fa2</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[business-intelligence-bi]]></category>
            <category><![CDATA[microsoft-excel]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[power-bi]]></category>
            <dc:creator><![CDATA[Suliyat Abimbola]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 09:22:25 GMT</pubDate>
            <atom:updated>2025-02-06T09:22:25.124Z</atom:updated>
            <content:encoded><![CDATA[<p>The objective of this project is to clean the data provided and be made ready for analysis.</p><p>Problems to look out for are:</p><p>· Incorrect data types</p><p>· Missing values</p><p>· Inconsistent data</p><p>· Errors in spellings and values</p><p>· Wrong calculations across rows and columns</p><p>· Unnecessary whitespace</p><p><strong>ABOUT THE DATA</strong></p><p>The FIFA 2021 dataset was gotten from Splendor Analytics. It consists of 18,979 rows which indicates the total number of players and 77 columns. The columns include ID, Name, Age, Nationality, Value, Wage, Contract, Position, Hits, Height, Weight and so on.</p><p>Data cleaning is the process of identifying, correcting and transforming raw data into a clean, consistent, accurate and reliable format for analysis. It is a critical step in the data analysis process ensures completeness and reliability of the data to achieve high quality data. Data cleaning is important to improve accuracy, reduces error, and increases data quality.</p><p><strong>DATA CLEANING APPROACH</strong></p><ol><li>Data Extraction: The raw dataset was originally downloaded from Splendor Analytics drive as a CSV (Comma separated values) format and was loaded into Microsoft Excel. The Screenshot below shows when the raw data was loaded into Excel.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*wN0FWLP75BXjwdHQ2X0edQ.png" /><figcaption>Before Cleaning</figcaption></figure><p>2. Data Exploration: The data was reviewed in order to gain a better understanding of what the data is saying. All columns were reviewed, and during the process, some of the columns have inconsistent datatypes and unusual characters were spotted while some contain null values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*yQlVtTDpUcFZE9mdpLqKXg.png" /><figcaption>Inconsistent and unusual characters</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*6m4uivUJe8blCoK8tHw3fQ.png" /><figcaption>Unusual characters</figcaption></figure><p>3. Data Cleaning: After exploring the data to get more understanding, it was loaded to Power Query Editor for the Cleaning processes. In order to have a clean data, the file origin at the top left corner of the power query preview was changed to Unicode (UTF-8).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*93TYlaroOmABtVUQUKNyYw.png" /><figcaption>Loading to Power Query</figcaption></figure><p>The importance of Unicode (UTF-8) is to ensure proper encoding and handling of text data particularly when dealing with unusual characters. It also ensures smooth integration and processing of data.</p><p>On the preview page, click on transform data to load to Power Query.</p><p>After importing the data into the Power Query, the data had some extra white spaces and they were removed by clicking on the view tab, and uncheck the show whitespace and it automatically adjust to the normal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*3SVnetBAlGwx7SpKdY0Kog.png" /><figcaption>Power Query Editor</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*I7Hi24-HKdJHV_j5lKkJ1Q.png" /><figcaption>After removing the whitespaces</figcaption></figure><p><strong>ID COLUMN:</strong> This column uniquely identifies each record in the dataset. It was noticed that the characters length in the ID column wasn’t the same, the length comprises of 2,4,5 &amp;6. The characters length was known by adding a new column in the add column tab and click on extract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*53viAPbmvgPKHnv6fpURzw.png" /><figcaption>ID column with different character length</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*pCphduZDLl1RkC5ZysVsXg.png" /><figcaption>After extracting the characters length</figcaption></figure><p>After extraction, it was noticed that the two (2) length characters was just one player with ID 41, 6 players have four (4) length characters. Five (5) and six (6) length characters were quite much. It raised a concerned, and questions were asked on google to know why IDs have different character length to confirm the integrity of the data. It was later realized that the player URL column contains players name without unusual characters and ID number. The ID number in the player URL were compared with the Id column and they were found to be the same. I didn’t bother to search on google again.</p><p>The image below shows the Player URL which contains both name and ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*kjAXTpBNEuy-_X5NqQ9dXQ.png" /><figcaption>Players URL containing names and ID</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*zLvkqasyemsaus-1g6C6Rg.png" /><figcaption>Process of extracting the names</figcaption></figure><p><strong>NAME: </strong>This column contains the players name with unusual characters. Since the players name are found on the player URL without unusual characters, they were extracted and replaced with the names on the name column. To extract the players names from the Player URL column, click on add column tab and extract, click on text between delimiters, since there are a lot of text/values between the delimiters. After clicking on the text between delimiters, the advanced option was navigated to specify where it should start from i.e, the beginning of the input or from the end. From the end was chosen because the players name was closer to the end of the URL. The start and end delimiters were chosen and the number of start delimiters to skip was taken to be two (2) because the delimiters appeared twice before the player’s name. The names were extracted and it was moved to the beginning of the data column. To move the column, right click on the column to be moved and move to your desired position.</p><p>After extraction of the players name, the new column was cleaned by getting rid of the delimiters. The replace value option was used. To get the replace value, right click on the new column, click on replace value, put the delimiter to replace in the value to find and replace with space by click on space on your keyboard, then ok. With this, the delimiters were removed and there was space between the names. Each word in the new column were capitalized by right clicking on the column, transform and capitalized each word. The main Name column was removed and the new column was renamed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*17Yw67IyfBNW_QjHuNQLAA.png" /><figcaption>Name Extraction</figcaption></figure><p>The Photo URL, Player URL and the Long Name columns are meta-data. Meta-data is a set of data that describes and gives information about another data. They were removed since they won’t be used.</p><p><strong>NATIONALITY AND AGE:</strong> The Nationality column refers to the country the players belong to, either by birth or citizenship. The Age column refers to the age of the players. These columns were considered okay. No null values or data type issues.</p><p><strong>CLUB:</strong> This column refers to the club the players belong to. In the club column, a lot of unusual characters were noticed. So, the unusual characters were searched for on google and replaced with the actual characters. Here is the link used to get the actual characters; <a href="https://www.i18nqa.com/debug/utf8-debug.html">https://www.i18nqa.com/debug/utf8-debug.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*IxWS2nGkD9vw5zEHNvCNnw.png" /><figcaption>Replacing Unusual Characters with the actual character</figcaption></figure><p><strong>OVA AND POT: </strong>The meaning of this column was found to be Player Overall Rating and Overall Potential. The unusual character found together with the OVA column name was removed.</p><p><strong>CONTRACT: </strong>This column represents the players start and end of contract in years. Some players contracts are paid, some players are on loan and others are free. The contract column was split using conditional column on the add column tab. The column was split into contract, loan and free. The newly created contract column was split to know the start and end date of the contract by right clicking on the column and split by delimiters. Go to custom and type the delimiter (~) used to separate the years and space to avoid space in the end date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*fbLNLytKGH1CanzEA26g-Q.png" /><figcaption>Splitting of the Contract Column</figcaption></figure><p>The newly created loan column had 95% null values and 3% loan. The date was replaced with only date instead of date and loan; i.e Dec 31, 2021 on Loan to Dec 31, 2021. The loan column was highlighted, right click and replace value. Value to find was typed as on loan and replaced with nothing, to achieve Dec 31, 2021, and the column was renamed to loan date end. The years from loan date end and loan date begins were extracted by delimiters. After the year extraction, the loan date begins and loan date end were merged with contract begins and contract ends, and the columns were renamed to Contract/Loan begins and Contract/Loan ends. The datatypes were changed to date type and only the year was selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*d9BhaU0rdM5YllXUbbXm6A.png" /><figcaption>Splitting Loan contract from others</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*QxxyxuoItuev0S3kUuA23Q.png" /><figcaption>After splitting the column</figcaption></figure><p>The reason for the 3% error in the column profile is because of the players that are free. There is no way a date will be added. That is why the column was left that way.</p><p><strong>HEIGHT: </strong>This column represents the height of each player. Some heights are measured in cm while some in feet and inches. To make this column consistent, I converted the column to inches. Firstly, the column was separated into two (2) different columns by splitting the data with cm in a column and ftinch into the other column using conditional column. After separation, the ft was split from the inches so as to convert the foot to inches. The ft was split by delimiter using custom and single quote (‘).</p><p>1ft = 12 inches</p><p>5’10&quot; = (5*12) + 10&quot; = 70&quot;</p><p>The ft column was multiplied by 12 using standard option in the transform tab. After multiplying the two (2) columns, ft and inches were selected, click on add column, standard and the columns were added together. The column is now in inches.</p><p>The cm was extracted from the height column using the above steps; conditional column. After extraction, the cm in the values were removed by replace values so as to change the datatype to numeric for conversion to inches.</p><p>1cm = 0.393inch</p><p>The extracted cm column was multiplied by 0.393 using the standard option in the transform tab. After the multiplication, the column was rounded up to the nearest whole number using the round up option in the transform tab. The two columns were merged and renamed to Height (inch). All the newly created columns were removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*KFJIAz0LeTYki1bVEry4kw.png" /><figcaption>Separating cm from ftin</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*fjvHCIZQTveAW0govXs4vQ.png" /><figcaption>Separating ft from inches</figcaption></figure><p><strong>WEIGHT:</strong> This column represents the weight of players. The column values contain pounds and kilogram (lbs &amp; kg). The column is to be converted to kg. The conversion steps are the same with the height conversion.</p><p>1lbs = 0.45kg</p><p><strong>VALUE, WAGE AND RELEASE CLAUSE: </strong>These columns represent the market value, weekly wage and release clause of players. The value and wage columns have unusual characters and they were removed by replacing the unusual character with nothing. The values were also not consistent, some values are in M while some are in K. The M were replaced with six (6) zeros while the K was replaced with three (3) zeros. All these were done to have consistent data and to be able to perform calculations.</p><p><strong>W/F AND SM: </strong>These columns contain unusual character and it was removed by replace value method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*F6XzHlAp755Uk1LsxKDV8Q.png" /><figcaption>Replacing unusual character with space</figcaption></figure><p><strong>HITS:</strong> This column also contains inconsistent data. The column was cleaned with the step used to clean the value column.</p><p>After the dataset was cleaned, it was closed and loaded to Excel and ready for analysis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8f2e66b5fa2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>