This project showcases the analysis and visualization of sales data from a company. It demonstrates data cleaning using SQL and the creation of an interactive dashboard using PostgreSQL and visualization tools.
The goal of this project is to transform raw sales data into actionable insights. It starts with importing the data into a database using a SQL script, followed by cleaning and managing it in PostgreSQL, and ends with building a dynamic dashboard.
-
Data Import:
- Imported raw sales data into the SQL database using a structured .sql file.
-
Data Cleaning:
- Removed unnecessary strings, duplicates, null values, and unwanted records (e.g., entries with negative salaries) using SQL queries.
-
Database Management:
- The cleaned data was stored in PostgreSQL for structured management.
-
Interactive Dashboard:
- Connected the PostgreSQL database to a visualization tool for building an interactive dashboard.
PostgreSQL: For data import, cleaning, and transformations.
Dashboard Tool: Power BI for creating visualizations.
- db_dump.sql : SQL file for importing raw data into the database and cleaning it. (Note:It's syntax is according to MySQL Environment,For other environment either convert it or do table creation manually.
- salesinsight.pbix : Power BI dashboard file
The project involves five tables that represent different facets of the company’s sales data:
-
Customers Table
customer_code,customer_nameandcustomer_type
-
date
date,cy_date,year,month_nameanddate_yy_mmm- Removed unwanted strings from columns like '/r' from
date_yy_mmm - SQL Query :
update date set date_yy_mmm = replace(date_yy_mmm,'\r','') where date_yy_mmm like '%\r%';
-
markets
markets_code,markets_nameandzone- Removed null values
- SQL Query :
Delete from markets m where m.zone='';
-
products
product_codeandproduct_type- Removed unwanted strings from columns like '/r' from
product_type - SQL Syntax :
update products set product_type = Replace(product_type,'\r','') where product_type like '%\r%';
-
transactions
product_code,customer_code,market_code,order_date,sales_qty,sales_amountandcurrency- Removed records with negative sales_amount
- SQL Syntax :
Delete from transactions where sales_amount <=0; - Removed duplicates as here
currencyContains INR/USD and INR/r or USD/r - SQL Syntax :
Delete from transactions where currency NOT like '%\r%';
The interactive dashboard includes:
- Top Customers: Highlight best customers (in terms of revenue and quantity ordered) through bar chart.
- Sales Trends: Time-series visualization to track sales performance.
- Regional Analysis: Showing revenue generation across different regions.
- Name : Ankit Rai
- LinkedIn: Ankit Rai

