top of page
  • Writer's pictureakshitha singareddy

Unveiling Sales Insights with SQL and Tableau: A Journey of Data Exploration

Introduction

In today's data-driven world, businesses rely heavily on data analysis to make informed decisions. Our journey begins with a sales dataset, provided in SQL format, and ends with a comprehensive Tableau dashboard that visualizes key insights. This blog post will walk you through the process of exploratory data analysis (EDA), data cleaning, and visualization, aimed at uncovering the reasons behind declining sales for a hardware company.

Tableau visualization of sales data analysis I have published to tableau public can be found here https://public.tableau.com/app/profile/akshitha.singareddy/viz/SalesRevenueInsights_generatedby_singareddy/Dashboard2



Step 1: Setting Up the Environment

Before diving into the data analysis, we need to set up our environment. Follow these steps:

  1. Install MySQL: Ensure MySQL is installed on your machine.

  2. Import the Sales Dataset: Import the provided sales.sql file into MySQL.

  3. Download Tableau Desktop: Install Tableau Desktop to visualize the data.

Step 2: Exploratory Data Analysis (EDA) with SQL

EDA helps in understanding the dataset's structure, identifying missing values, and uncovering initial insights. Write SQL queries to perform EDA:

Step 3: Data Cleaning and Preprocessing

Cleaning and preprocessing the data is crucial before visualization. This involves handling missing values, removing duplicates, and ensuring data consistency.

  1. Handle Missing Values: Identify and fill or remove missing values.

  2. Remove Duplicates: Ensure there are no duplicate records in the dataset.

  3. Convert Date Formats: Use string functions to convert date formats if necessary.

Step 4: Connecting Tableau to MySQL

  1. Connect to MySQL: Open Tableau and connect to the MySQL server.

  2. Import Data: Import the cleaned data tables (transactions, customers, products, markets, date).

  3. Establish Relationships: Create relationships between the fact table (transactions) and dimension tables (customers, products, markets, date) to form a star schema.

Step 5: Creating Tableau Visualizations

With the data prepared and connected, it's time to create insightful visualizations. Here are the key steps:

  1. Create Sheets:

  • Revenue vs. Market: Bar chart showing revenue by market.

  • Sales Quantity vs. Market: Bar chart showing sales quantity by market.

  • Revenue by Year: Line chart showing revenue trends over the years.

  • Top 3 Products by Revenue: Bar chart showing the top 3 products by revenue.

  • Top 3 Customers by Revenue: Bar chart showing the top 3 customers by revenue.

  1. Combine Sheets into a Dashboard:

  • Combine the individual sheets into a comprehensive dashboard.

  • Apply filters for year, month, and market to allow for detailed analysis.

Step 6: Insights and Analysis

After creating the visualizations, analyze the data to answer key business questions:

  1. Top 3 Customers: Identify the top 3 customers contributing the most revenue.

  2. Weakest Regions: Highlight the regions with the lowest sales.

  3. Revenue Trends: Analyze the revenue trends over the years and identify any patterns.

  4. Aggregate Revenue: Calculate the aggregate revenue over the last year.

Conclusion

By following this comprehensive approach, we have transformed raw sales data into valuable insights using SQL and Tableau. This analysis helps the hardware company understand their sales performance, identify key customers, and pinpoint areas for improvement. The visualizations provide a clear and interactive way to explore the data, facilitating better decision-making.

20 views0 comments

Comments


bottom of page