From f997f70a4b134813b33715bb3cfa4c4fd38f3214 Mon Sep 17 00:00:00 2001 From: dal Date: Fri, 2 May 2025 15:16:38 -0600 Subject: [PATCH] null not as string on number separator style --- api/libs/database/seed.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/libs/database/seed.sql b/api/libs/database/seed.sql index 287ad499d..9205257f7 100644 --- a/api/libs/database/seed.sql +++ b/api/libs/database/seed.sql @@ -1238,7 +1238,7 @@ fda05357-5c8c-5877-ba40-2ee74512cf88 Unique Customers (Last 3 Days) Unique Custo 5bb48c11-86c4-52e7-8019-b835c801fbe8 Last 30 Products Sold Last 30 Products Sold {"sql": "WITH recent_sales AS (\\n SELECT\\n p.name AS product_name,\\n soh.orderdate AS order_date,\\n ROW_NUMBER() OVER(ORDER BY soh.orderdate DESC, sod.salesorderdetailid DESC) as rn\\n FROM postgres.ont_ont.sales_order_detail AS sod\\n JOIN postgres.ont_ont.sales_order_header AS soh ON sod.salesorderid = soh.salesorderid\\n JOIN postgres.ont_ont.product AS p ON sod.productid = p.productid\\n)\\nSELECT\\n rs.product_name,\\n rs.order_date\\nFROM recent_sales rs\\nWHERE rs.rn <= 30\\nORDER BY rs.order_date DESC;\\n", "name": "Last 30 Products Sold", "timeFrame": "Recent Sales", "chartConfig": {"tableColumnOrder": ["product_name", "order_date"], "selectedChartType": "table", "columnLabelFormats": {"order_date": {"style": "date", "columnType": "date", "dateFormat": "MMM D, YYYY", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "product_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}}}, "description": "What were the last 30 products sold based on order date?"} notRequested \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce 1fe85021-e799-471b-8837-953e9ae06e4c 2025-05-02 17:24:57.3234+00 2025-05-02 17:24:57.323402+00 \N f \N \N {"1": {"content": {"sql": "WITH recent_sales AS (\\n SELECT\\n p.name AS product_name,\\n soh.orderdate AS order_date,\\n ROW_NUMBER() OVER(ORDER BY soh.orderdate DESC, sod.salesorderdetailid DESC) as rn\\n FROM postgres.ont_ont.sales_order_detail AS sod\\n JOIN postgres.ont_ont.sales_order_header AS soh ON sod.salesorderid = soh.salesorderid\\n JOIN postgres.ont_ont.product AS p ON sod.productid = p.productid\\n)\\nSELECT\\n rs.product_name,\\n rs.order_date\\nFROM recent_sales rs\\nWHERE rs.rn <= 30\\nORDER BY rs.order_date DESC;\\n", "name": "Last 30 Products Sold", "timeFrame": "Recent Sales", "chartConfig": {"tableColumnOrder": ["product_name", "order_date"], "selectedChartType": "table", "columnLabelFormats": {"order_date": {"style": "date", "columnType": "date", "dateFormat": "MMM D, YYYY", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "product_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}}}, "description": "What were the last 30 products sold based on order date?"}, "updated_at": "2025-05-02T17:24:57.323408Z", "version_number": 1}} {"row_count": 15, "column_count": 2, "column_metadata": [{"name": "product_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 9}, {"name": "order_date", "type": "timestamp", "max_value": "2025-03-28 00:00:00", "min_value": "2025-03-28 00:00:00", "simple_type": "date", "unique_values": 1}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a ea77637c-d3b3-5dda-a86e-0f6189b73026 Total Sales Revenue (Last Week Apr 20-26) Total Sales Revenue (Last Week Apr 20-26) {"sql": "SELECT\\n COALESCE(SUM(soh.subtotal), 0) AS total_revenue\\nFROM postgres.ont_ont.sales_order_header AS soh\\nWHERE soh.orderdate >= '2025-04-20' AND soh.orderdate < '2025-04-27'\\n", "name": "Total Sales Revenue (Last Week Apr 20-26)", "timeFrame": "April 20, 2025 - April 26, 2025", "chartConfig": {"metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Revenue", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "What was the total sales revenue last week (Apr 20-26, 2025)?"} notRequested \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce 1fe85021-e799-471b-8837-953e9ae06e4c 2025-05-02 17:28:17.546743+00 2025-05-02 17:28:17.546746+00 \N f \N \N {"1": {"content": {"sql": "SELECT\\n COALESCE(SUM(soh.subtotal), 0) AS total_revenue\\nFROM postgres.ont_ont.sales_order_header AS soh\\nWHERE soh.orderdate >= '2025-04-20' AND soh.orderdate < '2025-04-27'\\n", "name": "Total Sales Revenue (Last Week Apr 20-26)", "timeFrame": "April 20, 2025 - April 26, 2025", "chartConfig": {"metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Revenue", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "What was the total sales revenue last week (Apr 20-26, 2025)?"}, "updated_at": "2025-05-02T17:28:17.546754Z", "version_number": 1}} {"row_count": 1, "column_count": 1, "column_metadata": [{"name": "total_revenue", "type": "float8", "max_value": 0.0, "min_value": 0.0, "simple_type": "number", "unique_values": 1}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a e4364372-02f8-5f68-b65d-6b2594e90c74 Total Sales Revenue (Last Month April 2025) Total Sales Revenue (Last Month April 2025) {"sql": "SELECT\\n COALESCE(SUM(soh.subtotal), 0) AS total_revenue\\nFROM postgres.ont_ont.sales_order_header AS soh\\nWHERE soh.orderdate >= '2025-04-01' AND soh.orderdate < '2025-05-01'\\n", "name": "Total Sales Revenue (Last Month April 2025)", "timeFrame": "April 2025", "chartConfig": {"metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Revenue", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "What was the total sales revenue last month (April 2025)?"} notRequested \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce 1fe85021-e799-471b-8837-953e9ae06e4c 2025-05-02 17:28:17.561349+00 2025-05-02 17:28:17.561352+00 \N f \N \N {"1": {"content": {"sql": "SELECT\\n COALESCE(SUM(soh.subtotal), 0) AS total_revenue\\nFROM postgres.ont_ont.sales_order_header AS soh\\nWHERE soh.orderdate >= '2025-04-01' AND soh.orderdate < '2025-05-01'\\n", "name": "Total Sales Revenue (Last Month April 2025)", "timeFrame": "April 2025", "chartConfig": {"metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Revenue", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "What was the total sales revenue last month (April 2025)?"}, "updated_at": "2025-05-02T17:28:17.561360Z", "version_number": 1}} {"row_count": 1, "column_count": 1, "column_metadata": [{"name": "total_revenue", "type": "float8", "max_value": 0.0, "min_value": 0.0, "simple_type": "number", "unique_values": 1}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a -2b569e92-229b-5cad-b312-b09c751c544d Yearly Sales Revenue by Product - Signature Cycles (2022-Present) Yearly Sales Revenue by Product - Signature Cycles (2022-Present) {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nyearly_product_sales AS (\\n SELECT\\n EXTRACT(YEAR FROM soh.orderdate) AS sale_year,\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_sales_revenue\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n sale_year,\\n product_name\\n)\\nSELECT\\n CAST(yps.sale_year AS INTEGER) AS sale_year,\\n yps.product_name,\\n COALESCE(yps.total_sales_revenue, 0) AS total_sales_revenue\\nFROM\\n yearly_product_sales AS yps\\nORDER BY\\n yps.sale_year ASC,\\n yps.product_name ASC;\\n", "name": "Yearly Sales Revenue by Product - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["sale_year"], "y": ["total_sales_revenue"], "category": ["product_name"]}, "selectedChartType": "bar", "columnLabelFormats": {"sale_year": {"style": "number", "columnType": "number", "displayName": "Year", "numberSeparatorStyle": "null", "maximumFractionDigits": 0, "replaceMissingDataWith": 0}, "product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_sales_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What is the total yearly sales revenue for each product supplied by Signature Cycles from 2022 to present?"} inReview \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce c2dd64cd-f7f3-4884-bc91-d46ae431901e 2025-05-02 17:26:38.644943+00 2025-05-02 17:47:55.137382+00 \N f \N \N {"1": {"content": {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nyearly_product_sales AS (\\n SELECT\\n EXTRACT(YEAR FROM soh.orderdate) AS sale_year,\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_sales_revenue\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n sale_year,\\n product_name\\n)\\nSELECT\\n CAST(yps.sale_year AS INTEGER) AS sale_year,\\n yps.product_name,\\n COALESCE(yps.total_sales_revenue, 0) AS total_sales_revenue\\nFROM\\n yearly_product_sales AS yps\\nORDER BY\\n yps.sale_year ASC,\\n yps.product_name ASC;\\n", "name": "Yearly Sales Revenue by Product - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["sale_year"], "y": ["total_sales_revenue"], "category": ["product_name"]}, "selectedChartType": "bar", "columnLabelFormats": {"sale_year": {"style": "number", "columnType": "number", "displayName": "Year", "numberSeparatorStyle": "null", "maximumFractionDigits": 0, "replaceMissingDataWith": 0}, "product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_sales_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What is the total yearly sales revenue for each product supplied by Signature Cycles from 2022 to present?"}, "updated_at": "2025-05-02T17:47:55.137294Z", "version_number": 1}} {"row_count": 4, "column_count": 3, "column_metadata": [{"name": "sale_year", "type": "int4", "max_value": 2025.0, "min_value": 2024.0, "simple_type": "number", "unique_values": 2}, {"name": "product_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 2}, {"name": "total_sales_revenue", "type": "float8", "max_value": 17767.89, "min_value": 5007.17, "simple_type": "number", "unique_values": 4}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a +2b569e92-229b-5cad-b312-b09c751c544d Yearly Sales Revenue by Product - Signature Cycles (2022-Present) Yearly Sales Revenue by Product - Signature Cycles (2022-Present) {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nyearly_product_sales AS (\\n SELECT\\n EXTRACT(YEAR FROM soh.orderdate) AS sale_year,\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_sales_revenue\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n sale_year,\\n product_name\\n)\\nSELECT\\n CAST(yps.sale_year AS INTEGER) AS sale_year,\\n yps.product_name,\\n COALESCE(yps.total_sales_revenue, 0) AS total_sales_revenue\\nFROM\\n yearly_product_sales AS yps\\nORDER BY\\n yps.sale_year ASC,\\n yps.product_name ASC;\\n", "name": "Yearly Sales Revenue by Product - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["sale_year"], "y": ["total_sales_revenue"], "category": ["product_name"]}, "selectedChartType": "bar", "columnLabelFormats": {"sale_year": {"style": "number", "columnType": "number", "displayName": "Year", "numberSeparatorStyle": null, "maximumFractionDigits": 0, "replaceMissingDataWith": 0}, "product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_sales_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What is the total yearly sales revenue for each product supplied by Signature Cycles from 2022 to present?"} inReview \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce c2dd64cd-f7f3-4884-bc91-d46ae431901e 2025-05-02 17:26:38.644943+00 2025-05-02 17:47:55.137382+00 \N f \N \N {"1": {"content": {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nyearly_product_sales AS (\\n SELECT\\n EXTRACT(YEAR FROM soh.orderdate) AS sale_year,\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_sales_revenue\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n sale_year,\\n product_name\\n)\\nSELECT\\n CAST(yps.sale_year AS INTEGER) AS sale_year,\\n yps.product_name,\\n COALESCE(yps.total_sales_revenue, 0) AS total_sales_revenue\\nFROM\\n yearly_product_sales AS yps\\nORDER BY\\n yps.sale_year ASC,\\n yps.product_name ASC;\\n", "name": "Yearly Sales Revenue by Product - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["sale_year"], "y": ["total_sales_revenue"], "category": ["product_name"]}, "selectedChartType": "bar", "columnLabelFormats": {"sale_year": {"style": "number", "columnType": "number", "displayName": "Year", "numberSeparatorStyle": null, "maximumFractionDigits": 0, "replaceMissingDataWith": 0}, "product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_sales_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What is the total yearly sales revenue for each product supplied by Signature Cycles from 2022 to present?"}, "updated_at": "2025-05-02T17:47:55.137294Z", "version_number": 1}} {"row_count": 4, "column_count": 3, "column_metadata": [{"name": "sale_year", "type": "int4", "max_value": 2025.0, "min_value": 2024.0, "simple_type": "number", "unique_values": 2}, {"name": "product_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 2}, {"name": "total_sales_revenue", "type": "float8", "max_value": 17767.89, "min_value": 5007.17, "simple_type": "number", "unique_values": 4}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a b401778a-bd93-53f4-b884-236aaf62c9a8 Top 10 Most Active Vendors by Purchase Order Count (Last 3 Years) Top 10 Most Active Vendors by Purchase Order Count (Last 3 Years) {"sql": "WITH vendor_order_counts AS (\\n SELECT\\n v.name AS vendor_name,\\n COUNT(poh.purchaseorderid) AS order_count\\n FROM postgres.ont_ont.purchase_order_header AS poh\\n JOIN postgres.ont_ont.vendor AS v\\n ON poh.vendorid = v.businessentityid\\n WHERE\\n poh.orderdate >= '2022-05-02'\\n AND poh.orderdate <= '2025-05-02'\\n GROUP BY\\n v.name\\n)\\nSELECT\\n voc.vendor_name,\\n voc.order_count\\nFROM vendor_order_counts AS voc\\nORDER BY\\n voc.order_count DESC\\nLIMIT 10\\n", "name": "Top 10 Most Active Vendors by Purchase Order Count (Last 3 Years)", "timeFrame": "Last 3 Years", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["vendor_name"], "y": ["order_count"]}, "selectedChartType": "bar", "columnLabelFormats": {"order_count": {"style": "number", "columnType": "number", "displayName": "Purchase Order Count", "numberSeparatorStyle": ",", "maximumFractionDigits": 0, "minimumFractionDigits": 0, "replaceMissingDataWith": 0}, "vendor_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}}}, "description": "Which vendors had the highest number of purchase orders placed with them in the last 3 years (May 2, 2022 - May 2, 2025)?"} verified \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce c2dd64cd-f7f3-4884-bc91-d46ae431901e 2025-05-02 17:27:03.199276+00 2025-05-02 17:47:48.162514+00 \N f \N \N {"1": {"content": {"sql": "WITH vendor_order_counts AS (\\n SELECT\\n v.name AS vendor_name,\\n COUNT(poh.purchaseorderid) AS order_count\\n FROM postgres.ont_ont.purchase_order_header AS poh\\n JOIN postgres.ont_ont.vendor AS v\\n ON poh.vendorid = v.businessentityid\\n WHERE\\n poh.orderdate >= '2022-05-02'\\n AND poh.orderdate <= '2025-05-02'\\n GROUP BY\\n v.name\\n)\\nSELECT\\n voc.vendor_name,\\n voc.order_count\\nFROM vendor_order_counts AS voc\\nORDER BY\\n voc.order_count DESC\\nLIMIT 10\\n", "name": "Top 10 Most Active Vendors by Purchase Order Count (Last 3 Years)", "timeFrame": "Last 3 Years", "chartConfig": {"barLayout": "vertical", "barGroupType": "group", "barAndLineAxis": {"x": ["vendor_name"], "y": ["order_count"]}, "selectedChartType": "bar", "columnLabelFormats": {"order_count": {"style": "number", "columnType": "number", "displayName": "Purchase Order Count", "numberSeparatorStyle": ",", "maximumFractionDigits": 0, "minimumFractionDigits": 0, "replaceMissingDataWith": 0}, "vendor_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}}}, "description": "Which vendors had the highest number of purchase orders placed with them in the last 3 years (May 2, 2022 - May 2, 2025)?"}, "updated_at": "2025-05-02T17:47:48.162333Z", "version_number": 1}} {"row_count": 10, "column_count": 2, "column_metadata": [{"name": "vendor_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 10}, {"name": "order_count", "type": "int8", "max_value": 51.0, "min_value": 51.0, "simple_type": "number", "unique_values": 1}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a 629206aa-8842-584c-b113-d22baf7efafd Top 10 Products by Sales Revenue - Signature Cycles (2022-Present) Top 10 Products by Sales Revenue - Signature Cycles (2022-Present) {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nproduct_sales AS (\\n SELECT\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_product_sales\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n p.name\\n)\\nSELECT\\n ps.product_name,\\n COALESCE(ps.total_product_sales, 0) AS total_product_sales\\nFROM\\n product_sales AS ps\\nORDER BY\\n ps.total_product_sales DESC\\nLIMIT 10;\\n", "name": "Top 10 Products by Sales Revenue - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "horizontal", "barAndLineAxis": {"x": ["product_name"], "y": ["total_product_sales"]}, "selectedChartType": "bar", "columnLabelFormats": {"product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_product_sales": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What are the top 10 products by total sales revenue supplied by Signature Cycles from 2022 to present?"} requested \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce c2dd64cd-f7f3-4884-bc91-d46ae431901e 2025-05-02 17:23:03.602778+00 2025-05-02 17:48:01.382848+00 \N f \N \N {"1": {"content": {"sql": "WITH vendor_products AS (\\n SELECT\\n pv.productid\\n FROM\\n postgres.ont_ont.vendor AS v\\n JOIN\\n postgres.ont_ont.product_vendor AS pv\\n ON\\n v.businessentityid = pv.businessentityid\\n WHERE\\n v.name = 'Signature Cycles'\\n),\\nproduct_sales AS (\\n SELECT\\n p.name AS product_name,\\n SUM(sod.linetotal) AS total_product_sales\\n FROM\\n postgres.ont_ont.sales_order_detail AS sod\\n JOIN\\n postgres.ont_ont.sales_order_header AS soh\\n ON\\n sod.salesorderid = soh.salesorderid\\n JOIN\\n vendor_products AS vp\\n ON\\n sod.productid = vp.productid\\n JOIN\\n postgres.ont_ont.product AS p\\n ON\\n sod.productid = p.productid\\n WHERE\\n soh.orderdate >= '2022-01-01' AND soh.orderdate <= '2025-05-02'\\n GROUP BY\\n p.name\\n)\\nSELECT\\n ps.product_name,\\n COALESCE(ps.total_product_sales, 0) AS total_product_sales\\nFROM\\n product_sales AS ps\\nORDER BY\\n ps.total_product_sales DESC\\nLIMIT 10;\\n", "name": "Top 10 Products by Sales Revenue - Signature Cycles (2022-Present)", "timeFrame": "Jan 1, 2022 - May 2, 2025", "chartConfig": {"barLayout": "horizontal", "barAndLineAxis": {"x": ["product_name"], "y": ["total_product_sales"]}, "selectedChartType": "bar", "columnLabelFormats": {"product_name": {"style": "string", "columnType": "string", "displayName": "Product Name", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_product_sales": {"style": "currency", "currency": "USD", "columnType": "number", "displayName": "Total Sales Revenue", "numberSeparatorStyle": ",", "replaceMissingDataWith": 0}}}, "description": "What are the top 10 products by total sales revenue supplied by Signature Cycles from 2022 to present?"}, "updated_at": "2025-05-02T17:48:01.382759Z", "version_number": 1}} {"row_count": 2, "column_count": 2, "column_metadata": [{"name": "product_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 2}, {"name": "total_product_sales", "type": "float8", "max_value": 23140.74, "min_value": 22435.56, "simple_type": "number", "unique_values": 2}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a 27a226fe-d0bb-5d44-abed-11c8f86583b0 Top Customer by Revenue (All Time) Top Customer by Revenue (All Time) {"sql": "WITH customer_revenue AS (\\n SELECT\\n p.firstname || ' ' || p.lastname AS customer_name,\\n SUM(soh.subtotal) AS total_revenue\\n FROM postgres.ont_ont.sales_order_header AS soh\\n JOIN postgres.ont_ont.customer AS c ON soh.customerid = c.customerid\\n JOIN postgres.ont_ont.person AS p ON c.personid = p.businessentityid\\n WHERE p.persontype = 'IN' -- Filter for Individual customers, assuming 'IN' represents individuals based on common practice\\n GROUP BY\\n p.businessentityid, \\n p.firstname,\\n p.lastname\\n)\\nSELECT\\n cr.customer_name,\\n cr.total_revenue\\nFROM customer_revenue AS cr\\nORDER BY\\n cr.total_revenue DESC\\nLIMIT 1;\\n", "name": "Top Customer by Revenue (All Time)", "timeFrame": "All Time", "chartConfig": {"metricHeader": {"columnId": "customer_name", "useValue": true}, "metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"customer_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "Who is the customer with the highest total revenue across all orders?"} notRequested \N \N \N bf58d19a-8bb9-4f1d-a257-2d2105e7f1ce c2dd64cd-f7f3-4884-bc91-d46ae431901e 2025-05-02 17:49:30.06431+00 2025-05-02 17:49:30.064313+00 2025-05-02 17:50:36.648871+00 f \N \N {"1": {"content": {"sql": "WITH customer_revenue AS (\\n SELECT\\n p.firstname || ' ' || p.lastname AS customer_name,\\n SUM(soh.subtotal) AS total_revenue\\n FROM postgres.ont_ont.sales_order_header AS soh\\n JOIN postgres.ont_ont.customer AS c ON soh.customerid = c.customerid\\n JOIN postgres.ont_ont.person AS p ON c.personid = p.businessentityid\\n WHERE p.persontype = 'IN' -- Filter for Individual customers, assuming 'IN' represents individuals based on common practice\\n GROUP BY\\n p.businessentityid, \\n p.firstname,\\n p.lastname\\n)\\nSELECT\\n cr.customer_name,\\n cr.total_revenue\\nFROM customer_revenue AS cr\\nORDER BY\\n cr.total_revenue DESC\\nLIMIT 1;\\n", "name": "Top Customer by Revenue (All Time)", "timeFrame": "All Time", "chartConfig": {"metricHeader": {"columnId": "customer_name", "useValue": true}, "metricColumnId": "total_revenue", "selectedChartType": "metric", "columnLabelFormats": {"customer_name": {"style": "string", "columnType": "string", "numberSeparatorStyle": null, "replaceMissingDataWith": null}, "total_revenue": {"style": "currency", "currency": "USD", "columnType": "number", "numberSeparatorStyle": ",", "maximumFractionDigits": 2, "replaceMissingDataWith": 0}}}, "description": "Who is the customer with the highest total revenue across all orders?"}, "updated_at": "2025-05-02T17:49:30.064324Z", "version_number": 1}} {"row_count": 1, "column_count": 2, "column_metadata": [{"name": "customer_name", "type": "text", "max_value": null, "min_value": null, "simple_type": "string", "unique_values": 1}, {"name": "total_revenue", "type": "float8", "max_value": 13295.38, "min_value": 13295.38, "simple_type": "number", "unique_values": 1}]} \N cc3ef3bc-44ec-4a43-8dc4-681cae5c996a