More screenshots

    Works with the AI Agents you already use

    SQL Revenue Analytics

    by nwafor lawrence

    1

    Clean messy sales logs, warehouse them in SQL, and generate MoM/YTD growth analytics and HTML dashboards.

    $8

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    SQL Revenue Analytics

    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 / OutputVerified ResultFile
    Cleaned & Loaded Rows8 valid rows upserted (algebraically repaired ORD-1004 & ORD-1005)cleaned_revenue_data.csv
    Quarantined Rows2 invalid rows (MISSING_TRANSACTION_ID, INVALID_TIMESTAMP)rejected_rows.csv
    SQL Window Analytics7 months (2025-01 – 2025-07) · \$11,352.65 Total · +41.5% Latest MoMmom_ytd_analytics.csv
    SQL Warehouse Tablerevenue_data upserted on transaction_id PK (0 conflicts)revenue_warehouse.db
    Interactive DashboardMoM vs. YTD trajectory, country donut, product bars, and SQL tablesql_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

    Generated

    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_price or revenue values 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() and SUM() OVER queries 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

    1. Validation Run run_sql_pipeline.py with the --validate-only flag to check CSV or Excel headers against the required schema.
    2. ETL Execution Execute the pipeline with --input and --db-url to process files and upsert data into the warehouse.
    3. Reporting Review the generated mom_ytd_analytics.csv and sql_revenue_dashboard.html in 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Terminal / Shell
    Write Files
    Environment Variables
    Read Files

    File Scopes

    *.csv
    *.xlsx
    *.xls
    *.xlsm
    *.db
    *.sql
    *.html

    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.

    Listed7 days ago

    What's inside

    Frequently Asked Questions

    The skill requires basic transaction headers such as `transaction_id`, `quantity`, and `date`. It is designed to handle messy inputs, but rows missing both the price and total revenue simultaneously will be quarantined to ensure data integrity.

    You will receive the complete Python source code for the ETL pipeline, the SQL schema definitions, a CLI utility for execution, and a README documentation file for quick setup.

    The skill is built using Python and SQLAlchemy, making it compatible with any AI agent capable of executing Python scripts. It natively supports SQLite for local use and PostgreSQL for production-grade environments.

    Unlike a simple prompt, this skill includes pre-built algebraic logic and SQL window functions that prevent common calculation errors. It handles complex edge cases like mixed date formats and deduplication that basic LLMs often hallucinate or overlook.

    Yes, the skill includes a `--validate-only` flag that allows you to check your data against the required schema and identify formatting issues before any records are actually written to your database.

    Yes. By default it writes a local SQLite database (revenue_warehouse.db), and passing --db-url postgresql+psycopg2://... or setting DATABASE_URL automatically uses PostgreSQL syntax (TRUNCATE + DATE_TRUNC + ON CONFLICT DO UPDATE).

    When quantity > 0 and either unit_price or revenue is missing (#N/A, ?, FREE), it solves revenue = unit_price * quantity - discount_amount + tax_amount + shipping_amount (or its inverse for unit_price). Rows missing both or lacking a valid timestamp/transaction_id are quarantined to rejected_rows.csv.

    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.