- Home
- Skills
- Data & Databases
- SQL Revenue Analytics
More screenshots
Works with the AI Agents you already use
SQL Revenue Analytics
Clean messy sales logs, warehouse them in SQL, and generate MoM/YTD growth analytics and HTML dashboards.
$8
SQL Revenue Analytics
Example session with this skill installed
Clean our messy multi-channel sales export (sample_input.csv), repair any missing prices or totals, load the records into a SQLite revenue warehouse, run MoM/YTD SQL window analytics, and build the dashboard.
- Read your context and instructions
- Compiled the sql revenue analytics
- Generated the data export
SQL Revenue Pipeline & Window Analytics Complete
Processed
10 raw transactions from sample_input.csv—reconstructing missing financial values algebraically, quarantining broken rows, upserting into SQLite (revenue_data), and executing LAG() / SUM() OVER SQL window queries:
| Metric / Output | Verified Result | File |
|---|---|---|
| Cleaned & Loaded Rows | 8 valid rows upserted (algebraically repaired ORD-1004 & ORD-1005) | cleaned_revenue_data.csv |
| Quarantined Rows | 2 invalid rows (MISSING_TRANSACTION_ID, INVALID_TIMESTAMP) | rejected_rows.csv |
| SQL Window Analytics | 7 months (2025-01 – 2025-07) · \$11,352.65 Total · +41.5% Latest MoM | mom_ytd_analytics.csv |
| SQL Warehouse Table | revenue_data upserted on transaction_id PK (0 conflicts) | revenue_warehouse.db |
| Interactive Dashboard | MoM vs. YTD trajectory, country donut, product bars, and SQL table | sql_revenue_dashboard.html |
Open sql_revenue_dashboard.html in any browser to inspect all charts and monthly SQL window metrics.
sample_input.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Messy transaction logs and missing pricing data break revenue reporting pipelines. This skill automates the ETL process to clean sales files, algebraically repair missing values, and warehouse them in SQL for advanced window-function analytics.
What it does
- Data cleaning Standardizes inconsistent date formats and camelCase headers into a structured schema.
- Value repair Algebraically reconstructs missing
unit_priceorrevenuevalues using available transaction metadata. - SQL warehousing Upserts cleaned records into SQLite or PostgreSQL using SQLAlchemy to ensure primary key integrity.
- Window analytics Executes complex
LAG()andSUM() OVERqueries to calculate MoM growth and YTD cumulative revenue. - Dashboard generation Produces a standalone HTML dashboard with Plotly visualizations for monthly trajectories and geographical breakdowns.
How it works
- Validation Run
run_sql_pipeline.pywith the--validate-onlyflag to check CSV or Excel headers against the required schema. - ETL Execution Execute the pipeline with
--inputand--db-urlto process files and upsert data into the warehouse. - Reporting Review the generated
mom_ytd_analytics.csvandsql_revenue_dashboard.htmlin your specified output directory.
Frameworks & tools
Built with Python, Pandas, SQLAlchemy, and Plotly. Supports SQLite and PostgreSQL backends.
Why this beats prompting it yourself
Writing reliable SQL window functions and algebraic data repair logic in a single prompt often leads to calculation errors or schema mismatches. This skill provides a tested CLI framework that handles edge cases like #N/A values, mixed date formats, and transaction deduplication out of the box.
Use cases
- Migrating messy Shopify or Amazon export files into a structured SQL database.
- Calculating monthly revenue growth percentages for board reporting.
- Recovering total revenue figures when unit prices are missing from manual logs.
- Generating interactive sales dashboards without hosting a BI server.
Known limitations
Requires specific columns like transaction_id and quantity. Unparseable timestamps or rows with both missing price and revenue are quarantined.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago
- Software
Python 3.10+pandasnumpySQLAlchemyopenpyxl
- Optional
- PostgreSQL (or built-in SQLite)
Runs locally out of the box with SQLite and zero external API keys after `pip install -r requirements.txt`. Only install `psycopg2-binary` if writing directly to PostgreSQL via `--db-url` or `DATABASE_URL`; pass `--sheet` when targeting a non-default Excel tab.
Permissions
File Scopes
Reads local CSV or Excel sales files (or SQL_REVENUE_INPUT_PATH), respects optional SQL_REVENUE_OUTPUT_DIR and DATABASE_URL env vars, and outputs cleaned_revenue_data.csv, rejected_rows.csv, mom_ytd_analytics.csv, revenue_warehouse.db (or PostgreSQL rows), and sql_revenue_dashboard.html.
What's inside
Frequently Asked Questions
New in Data & Databases
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.