The Fini Marketing Intelligence platform ships nine purpose-built SQL queries that feed the Power BI dashboards and downstream Python analytics. Each query targets either theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/andresshm/fini-marketing-intelligence/llms.txt
Use this file to discover all available pages before exploring further.
fact_sales star-schema table — joined to dim_customers or dim_products where needed — or one of two enriched views: vw_sales_enriched and vw_product_launches. Together they cover executive-level KPIs, customer value segments, product performance, promotional impact, regional revenue distribution, seasonal demand patterns, and new-product launch velocity.
Executive & Financial
Executive KPIs
Executive KPIs
Source file:
Primary table:
sql/analytics/executive_kpis.sqlPrimary table:
fact_salesReturns a single aggregated row of top-line business metrics for use in executive dashboards and summary scorecards.| Column | Type | Description |
|---|---|---|
total_sales | integer | Total number of individual sale transactions |
total_revenue | numeric | Sum of revenue across all transactions |
total_margin | numeric | Sum of gross margin across all transactions |
avg_sale_value | numeric | Mean revenue per transaction |
total_units_sold | integer | Total units sold across all products |
Customer Analytics
Customer Segments
Customer Segments
Source file:
Primary tables:
sql/analytics/customer_segments.sqlPrimary tables:
fact_sales JOIN dim_customersAggregates revenue and purchase behaviour by the purchase_frequency dimension stored in dim_customers, enabling comparison of Low, Medium, and High frequency buyer segments.| Column | Type | Description |
|---|---|---|
purchase_frequency | text | Customer segment label (Low, Medium, High) from dim_customers |
customers | integer | Number of distinct customers in this frequency segment |
revenue | numeric | Total revenue contributed by the segment, rounded to 2 decimal places |
avg_sale | numeric | Average transaction revenue for customers in the segment |
Product Performance
Top Products
Top Products
Source file:
Primary tables:
Results are ordered by
sql/analytics/top_products.sqlPrimary tables:
fact_sales JOIN dim_productsReturns the ten highest-revenue products, enriched with category, margin, and unit volume. Used to identify hero SKUs and category leaders in product performance reports.| Column | Type | Description |
|---|---|---|
product_name | text | Display name of the product from dim_products |
category | text | Product category (e.g. Gummies, Belts, Seasonal) |
units_sold | integer | Total units sold for this product across all transactions |
revenue | numeric | Total revenue generated by the product |
margin | numeric | Total gross margin generated by the product |
revenue DESC and capped at the top 10 products.Seasonality Analysis
Seasonality Analysis
Source file:
Primary tables:
sql/analytics/seasonality_analysis.sqlPrimary tables:
fact_sales JOIN dim_productsBreaks down unit volume by calendar month and product season tag, exposing demand patterns across the year. Useful for production planning and seasonal campaign scheduling.| Column | Type | Description |
|---|---|---|
month | numeric | Calendar month number (1 = January … 12 = December) extracted from sale_date |
season | text | Season label assigned to the product in dim_products (e.g. Summer, Halloween, All Year) |
units_sold | integer | Total units sold for that month–season combination |
Promotions
Promotion Analysis
Promotion Analysis
Source file:
Primary table:
sql/analytics/promotion_analysis.sqlPrimary table:
fact_salesGroups all transactions by discount level, showing how average unit volume, revenue, and margin shift across each discount tier. Provides the quantitative foundation for promotion ROI decisions.| Column | Type | Description |
|---|---|---|
discount | numeric | Discount rate applied to the transaction (e.g. 0, 0.10, 0.20) |
transactions | integer | Number of transactions at this discount level |
avg_units | numeric | Mean units sold per transaction at this discount level |
avg_revenue | numeric | Mean revenue per transaction at this discount level |
avg_margin | numeric | Mean gross margin per transaction at this discount level |
Regional Performance
Sales by Region
Sales by Region
Source file:
Primary tables:
sql/analytics/sales_by_region.sqlPrimary tables:
fact_sales JOIN dim_customersAggregates revenue, margin, and unit volume by customer region, enabling geographic performance comparisons and identification of under-served markets.| Column | Type | Description |
|---|---|---|
region | text | Geographic region label from dim_customers (e.g. North, South, East, West) |
revenue | numeric | Total revenue generated by customers in this region |
margin | numeric | Total gross margin generated by customers in this region |
units | integer | Total units sold to customers in this region |
Product Launch Tracking
Launch Velocity
Launch Velocity
Source file:
Primary view:
sql/analytics/launch_velocity.sqlPrimary view:
vw_product_launchesPlots average daily revenue against days-since-launch for the first 90 days across all products, revealing the typical ramp-up curve for new SKUs at Fini.| Column | Type | Description |
|---|---|---|
days_since_launch | integer | Number of days elapsed since the product’s launch date (0–90) |
avg_revenue | numeric | Mean daily revenue across all products at this specific day post-launch |
Top Launches
Top Launches
Source file:
Primary view:
sql/analytics/top_launches.sqlPrimary view:
vw_product_launchesRanks every product by total revenue accumulated within its first 90 days on the market. The primary query for identifying breakout new products.| Column | Type | Description |
|---|---|---|
product_name | text | Name of the launched product |
revenue | numeric | Cumulative revenue in the first 90 days post-launch |
margin | numeric | Cumulative gross margin in the first 90 days post-launch |
units | integer | Total units sold in the first 90 days post-launch |
Category Launches
Category Launches
Source file:
Primary view:
sql/analytics/category_launches.sqlPrimary view:
vw_product_launchesSummarises launch performance at category level for the first 90 days, showing which product families perform best when introducing new SKUs.| Column | Type | Description |
|---|---|---|
category | text | Product category from vw_product_launches (e.g. Gummies, Belts, Seasonal) |
revenue | numeric | Cumulative revenue for new products in this category within the first 90 days |
margin | numeric | Cumulative gross margin for new products in this category within the first 90 days |