Skip to content

sreejaaryahi18/SnowflakeRetialDashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Retail Sales Dashboard

A fully interactive sales analytics dashboard built using Streamlit, Snowflake Snowpark, Pandas, and Altair. This dashboard allows users to explore and visualize retail sales data with dynamic filters and KPIs, all hosted directly inside Snowflake (no external server needed).


πŸš€ Features

  • πŸ“† Date Range Filtering – Explore data across custom time ranges.
  • 🌍 Region Filter – View sales performance across different regions.
  • 🏷 Category Filter – Analyze category-wise product performance.
  • πŸ’° Dynamic KPIs – See real-time totals for:
    • Total Sales
    • Total Orders
    • Average Order Value
  • πŸ“ˆ Sales Over Time – Interactive time-series chart.
  • πŸ“¦ Category-Wise Sales – Bar chart for product categories.
  • 🌐 Region-Wise Sales – Regional performance comparison.
  • 🧾 Raw Data Viewer – Toggle to inspect underlying data.

🧱 Tech Stack

Tool Purpose
Streamlit Interactive frontend UI and app logic
Snowflake Cloud data warehouse and compute
Snowpark Python API for querying Snowflake
Pandas Data manipulation
Altair Declarative data visualization

πŸ“‚ Project Structure

πŸ“ retail-sales-dashboard/ β”‚ β”œβ”€β”€ πŸ“„ streamlit_app.py # Main Streamlit app script β”œβ”€β”€ πŸ“„ README.md # Project overview (this file) β”œβ”€β”€ πŸ“„ requirements.txt # Python dependencies (optional) └── πŸ“Š Snowflake objects: β”œβ”€β”€ DATABASE: retail_analytics_db β”œβ”€β”€ SCHEMA: sales_data β”œβ”€β”€ TABLES: β”‚ β”œβ”€β”€ FACT_ORDERS β”‚ β”œβ”€β”€ DIM_PRODUCT β”‚ └── DIM_REGION


πŸ›  Setup Instructions

🧭 Snowflake Setup

  1. Create Database & Tables:
CREATE DATABASE retail_analytics_db;
CREATE SCHEMA sales_data;

CREATE OR REPLACE TABLE retail_sales_data (
  order_id STRING,
  product_id STRING,
  product_name STRING,
  category STRING,
  region STRING,
  quantity INTEGER,
  price FLOAT,
  order_date DATE
);
Load CSV data into retail_sales_data using Snowflake's COPY INTO.

Create Dimension and Fact Tables:
USE DATABASE retail_analytics_db;
USE SCHEMA sales_data;

CREATE OR REPLACE TABLE FACT_ORDERS AS
SELECT
    ORDER_ID,
    PRODUCT_ID,
    REGION,
    QUANTITY,
    PRICE,
    QUANTITY * PRICE AS TOTAL_AMOUNT,
    ORDER_DATE
FROM RETAIL_SALES_DATA;

CREATE OR REPLACE TABLE DIM_PRODUCT AS
SELECT DISTINCT
    PRODUCT_ID,
    PRODUCT_NAME,
    CATEGORY
FROM RETAIL_SALES_DATA;

CREATE OR REPLACE TABLE DIM_REGION AS
SELECT DISTINCT REGION FROM RETAIL_SALES_DATA;

▢️ Running the App
If running inside Snowflake Native App (hosted Streamlit):

No setup needed β€” simply open the Streamlit app in your Snowflake worksheet.

If running locally (optional):

bash
Copy
Edit
pip install -r requirements.txt
streamlit run streamlit_app.py
You'll need a valid Snowflake connection locally, which is not required inside Snowflake Native Streamlit.

![image](https://github.com/user-attachments/assets/07b2f0f2-79b0-4916-a664-ce96fa9d090a)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages