Report not found

There was a problem finding this report.

Report

Conversion Rate

Hats.com Products Popular with Socks.com Visitors

Socks.com Products Popular with Hats.com Visitors

Visitors

Cross-domain Dashboard: E-commerce
June 8, 2017 · Refreshed 8 days ago

Collaborators

Run History
SELECT socks.day AS time_period, 'day' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('day',t.sent_at) AS day, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('day',h.sent_at) AS day, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.day = hats.day JOIN ( SELECT DATE_TRUNC('day',t.sent_at) AS day, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('day',t.sent_at) = DATE_TRUNC('day',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.day = crossdomain.day UNION ALL SELECT socks.week AS time_period, 'week' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('week',t.sent_at) AS week, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('week',h.sent_at) AS week, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.week = hats.week JOIN ( SELECT DATE_TRUNC('week',t.sent_at) AS week, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('week',t.sent_at) = DATE_TRUNC('week',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.week = crossdomain.week UNION ALL SELECT socks.month AS time_period, 'month' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('month',t.sent_at) AS month, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('month',h.sent_at) AS month, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.month = hats.month JOIN ( SELECT DATE_TRUNC('month',t.sent_at) AS month, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('month',t.sent_at) = DATE_TRUNC('month',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.month = crossdomain.month ORDER BY 2,1
SELECT socks.day AS time_period, 'day' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('day',t.sent_at) AS day, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('day',h.sent_at) AS day, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.day = hats.day JOIN ( SELECT DATE_TRUNC('day',t.sent_at) AS day, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('day',t.sent_at) = DATE_TRUNC('day',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.day = crossdomain.day UNION ALL SELECT socks.week AS time_period, 'week' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('week',t.sent_at) AS week, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('week',h.sent_at) AS week, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.week = hats.week JOIN ( SELECT DATE_TRUNC('week',t.sent_at) AS week, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('week',t.sent_at) = DATE_TRUNC('week',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.week = crossdomain.week UNION ALL SELECT socks.month AS time_period, 'month' AS interval, socks.viewers - crossdomain.viewers AS "socks.com", hats.viewers - crossdomain.viewers AS "hats.com", crossdomain.viewers AS cross_domain, crossdomain.viewers / ( (socks.viewers - crossdomain.viewers) + (hats.viewers - crossdomain.viewers) )::numeric AS cross_domain_rate FROM ( SELECT DATE_TRUNC('month',t.sent_at) AS month, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t GROUP BY 1 ) AS socks JOIN ( SELECT DATE_TRUNC('month',h.sent_at) AS month, COUNT(DISTINCT h.anonymous_id) AS viewers FROM demo.hats_pages AS h GROUP BY 1 ) AS hats ON socks.month = hats.month JOIN ( SELECT DATE_TRUNC('month',t.sent_at) AS month, COUNT(DISTINCT t.anonymous_id) AS viewers FROM demo.socks_pages t JOIN demo.hats_pages AS h ON t.context_traits_cross_domain_id = h.context_traits_cross_domain_id AND DATE_TRUNC('month',t.sent_at) = DATE_TRUNC('month',h.sent_at) GROUP BY 1 ) AS crossdomain ON socks.month = crossdomain.month ORDER BY 2,1
SELECT DATE_TRUNC('day',hp.sent_at) AS time_period, 'day' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('week',hp.sent_at) AS time_period, 'week' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('month',hp.sent_at) AS time_period, 'month' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('day',hp.sent_at) AS time_period, 'day' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('week',hp.sent_at) AS time_period, 'week' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('month',hp.sent_at) AS time_period, 'month' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 ORDER BY 2,1
SELECT DATE_TRUNC('day',hp.sent_at) AS time_period, 'day' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('week',hp.sent_at) AS time_period, 'week' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('month',hp.sent_at) AS time_period, 'month' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on hats.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.hats_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.hats_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('day',hp.sent_at) AS time_period, 'day' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('week',hp.sent_at) AS time_period, 'week' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 UNION ALL SELECT DATE_TRUNC('month',hp.sent_at) AS time_period, 'month' AS interval, CASE WHEN ud.domain = 'Cross-domain' THEN 'Cross (on socks.com)' ELSE ud.domain END AS domain, COUNT(hp.context_traits_cross_domain_id) AS visits, COUNT(ho.context_traits_cross_domain_id) AS conversions, COUNT(ho.context_traits_cross_domain_id) / COUNT(hp.context_traits_cross_domain_id)::numeric AS conversion_rate FROM demo.socks_pages hp JOIN {{ @user_domain AS ud }} ON hp.context_traits_cross_domain_id = ud.context_traits_cross_domain_id LEFT JOIN demo.socks_orders ho ON hp.context_traits_cross_domain_id = ho.context_traits_cross_domain_id AND ho.sent_at BETWEEN hp.sent_at AND hp.sent_at + INTERVAL '2 HOURS' GROUP BY 1,2,3 ORDER BY 2,1
SELECT sop.name AS product, sop.image, SUM(quantity) AS units_sold, SUM(product_revenue) AS revenue FROM ( SELECT order_id, user_cross_domain_id, SPLIT_PART(product_name::varchar,'"',2) AS name, SPLIT_PART(image::varchar,'"',2) AS image, price::numeric AS price, quantity::numeric AS quantity, price::numeric * quantity::numeric AS product_revenue FROM ( SELECT order_id, user_cross_domain_id, products -> 'name' AS product_name, products -> 'image' AS image, products ->> 'price' AS price, products ->> 'quantity' AS quantity FROM ( SELECT id AS order_id, context_traits_cross_domain_id AS user_cross_domain_id, json_array_elements(products::json) AS products FROM demo.socks_orders ) orders ) order_products ORDER BY 1 ) AS sop JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON sop.user_cross_domain_id = ud.context_traits_cross_domain_id AND ud.domain = 'Cross-domain' GROUP BY 1,2 ORDER BY 3 DESC
SELECT sop.name AS product, sop.image, SUM(quantity) AS units_sold, SUM(product_revenue) AS revenue FROM {{ @socks_order_products AS sop }} JOIN {{ @user_domain AS ud }} ON sop.user_cross_domain_id = ud.context_traits_cross_domain_id AND ud.domain = 'Cross-domain' GROUP BY 1,2 ORDER BY 3 DESC
SELECT hop.name AS product, hop.image, SUM(quantity) AS units_sold, SUM(product_revenue) AS revenue FROM ( SELECT order_id, user_cross_domain_id, SPLIT_PART(product_name::varchar,'"',2) AS name, SPLIT_PART(image::varchar,'"',2) AS image, price::numeric AS price, quantity::numeric AS quantity, price::numeric * quantity::numeric AS product_revenue FROM ( SELECT order_id, user_cross_domain_id, products -> 'name' AS product_name, products -> 'image' AS image, products ->> 'price' AS price, products ->> 'quantity' AS quantity FROM ( SELECT id AS order_id, context_traits_cross_domain_id AS user_cross_domain_id, json_array_elements(products::json) AS products FROM demo.hats_orders ) orders ) order_products ORDER BY 1 ) AS hop JOIN ( SELECT context_traits_cross_domain_id, CASE WHEN domain_count = 2 THEN 'Cross-domain' WHEN domain = 'hats' THEN 'Only hats.com' ELSE 'Only socks.com' END AS domain FROM ( SELECT context_traits_cross_domain_id, STRING_AGG(domain,',') AS domain, COUNT(domain) AS domain_count FROM ( SELECT DISTINCT context_traits_cross_domain_id, 'hats' AS domain FROM demo.hats_pages hp UNION ALL SELECT DISTINCT context_traits_cross_domain_id, 'socks' AS domain FROM demo.socks_pages sp ) all_visitors GROUP BY 1 ) visitor_domain ) AS ud ON hop.user_cross_domain_id = ud.context_traits_cross_domain_id AND ud.domain = 'Cross-domain' GROUP BY 1,2 ORDER BY 3 DESC
SELECT hop.name AS product, hop.image, SUM(quantity) AS units_sold, SUM(product_revenue) AS revenue FROM {{ @hats_order_products AS hop }} JOIN {{ @user_domain AS ud }} ON hop.user_cross_domain_id = ud.context_traits_cross_domain_id AND ud.domain = 'Cross-domain' GROUP BY 1,2 ORDER BY 3 DESC
<style> .mode-filters { position: fixed; top: 0px; } </style> <link rel="stylesheet" href="https://mode.github.io/alamode/alamode.min.css"> <script src="https://mode.github.io/alamode/alamode.min.js"></script> <div class="mode-header embed-hidden"> <h1>{{ title }}</h1> <p>{{ description }}</p> </div> <div class="mode-grid container"> <div class="row"> <div class="col-md-12"> <mode-text id="text_5bf4dcae-37aa-4542-cbb9-c74e19640003" dataset="dataset" options="text_options"> <p class="ql-align-center"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAABkCAYAAAAVORraAAAAAXNSR0IArs4c6QAAMXRJREFUeAHtnQl8VdW979fa5yRhkMEqIBmYEnqdZYgKhPd6vc+27+OtDCJabbW2FVqnVgbHPm3uUAeU0Nr21qG3DjgWGUL7bO31Ve6nEBACKNapSYiRJAwiMoacaa/3W8cknnP22idnSs4J/Z0P4ey95v1d6/8/+79GIfghARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIgARIggROOQFNTk9J/J9yD8YFIgARIgARIgASiCFhRd7whARIgARIgARIgARIgARIgARIgARLICgEa6FnBzkxJgARIgARIgARIgARIgARIgARIIJoADfRoHrwjARIgARIgARIgARIgARIgARIggawQoIGeFezMlARIgARIgARIgARIgARI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3K8nMrXcRG9tWcWLiH+u5bEuRBt/AnnHlQWkEZYFr/RMrx5fcWaqxnlnWbRhXV1a8WB+2bRRHoGlMRI6ADtjd/o7vqEDUE7oAOvqIYMGjUHc/+hJ47wz/1XFU5pxtN33O+9jv2GkXzy7YeNNse6d9z1dx9p4hF78DvLr0sW4hi7OT0gXZ6sest3+OuuH3yRAArlPAO+H/JAACZDAiUkAozxy/x3bR/qD1gi8Gw9XtjwZ0yAPYsfmj/MKVKse2U72yXXHQ9DvvwAv1gdHlqlN8nvlgWTT6Ayvj3rbW5dXHBD+0dg9ejTc+2On3GbhsZrzB+bXd4yCdwbPyLdmsu9Hfx1u+4KjQiKIfK0RGM3bhxkRH/XLFx+d+pPJe2AURI2MZSRjJpIWgaampnCdjB49+oT73dZtcuauDSOFDTkNiOFKqpNhwB7EVOaPLa+3VY96pgXPJbLO9+rGN4b7VGgUZv2MFiEJWRD7pFd+5JF5H60c3fOyoI+R+7QpVBwI2KOhU0aHZKi/R1jNWOPenDdwaH3H6KvLE/Qd556o46t2bhrRJhSWU4UOjhjbb9PjMnVdnI16yIX213daEEtKAiRAAiRAAiRAAiRAAjlEQBvonUZ6DhWLRSEBEiABEiABEsgwAU5xzzBQJkcCJEACJEACJEACJEACJEACJEACqRCggZ4KNcYhARIgARIgARIgARIgARIgARIggQwToIGeYaBMjgRIgARIgARIgARIgARIgARIgARSIUADPRVqjEMCJEACJEACJEACJEACJEACJEACGSZAAz3DQJkcCZAACZAACZAACZAACZAACZAACaRCgAZ6KtQYhwRIgARIgARIgARIgARIgARIgAQyTIAGeoaBMjkSIAESIAESIAESIAESIAESIAESSIUADfRUqDEOCZAACZAACZAACZAACZAACZAACWSYAA30DANlciRAAiRAAiRAAiRAAiRAAiRAAiRAAiRAAiRAAiRAAicgAaWUpf9OwEfjI5EACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZAACZBA3yTw/wHyDn9dennxvQAAAABJRU5ErkJggg=="></p> </mode-text> </div> </div> <div class="row" data-row-height="medium"> <div class="col-md-4"> <mode-chart id="chart_ddd540a440c9" dataset="dataset" options="chart_options"></mode-chart> </div> <div class="col-md-8"> <mode-chart id="chart_2bf7a98553ed" dataset="dataset" options="chart_options"></mode-chart> </div> </div> <div class="row"> <div class="col-md-12"> <mode-chart id="chart_98ca79161bc2" dataset="dataset" options="chart_options"></mode-chart> </div> </div> <div class="row" data-row-height="large"> <div class="col-md-6"> <mode-table id="table_84544a8a818e" dataset="dataset" options="table_options"></mode-table> </div> <div class="col-md-6"> <mode-table id="table_7f1ec85c188c" dataset="dataset" options="table_options"></mode-table> </div> </div> </div> <script> customChartColors({ charts: ["chart_789a52ba3b3e"], colors: { 0: "#06D0AD", 1: "#DB38B7", 2: "#43A5DA" } }) customChartColors({ charts: ["chart_61ca46b08c2d"], colors: { 0: "#227dae", 1: "#83c4e7", 2: "#DB38B7", 3: "#06D0AD" } }) alamode.addImagesToTables({ table: "table_84544a8a818e", column: "image", image_height: 70 }) alamode.addImagesToTables({ table: "table_7f1ec85c188c", column: "image", image_height: 70 }) function customChartColors(o) { var charts = o["charts"], colors = o["colors"], opacities = o["opacity"], lineDashes = o["line_dashes"]; if (charts == "all") { charts = []; $("mode-chart").each(function() { charts.push(this.id); }); } function prepColors(id, colorList) { var chart = $("#" + id), series = chart.find('.nv-bar').length > 0 ? chart.find('.nv-group') : chart.find('.nv-noninteractive'), seriesCount = series.length, legend = chart.find(".nv-series .nv-legend-symbol"); var colors = {}; var m = {}; var r = {}; var counter = 0; if (legend.length == 0 && seriesCount <= 1) { m[0] = counter; r[counter] = 0; colors[0] = colorList[0]; } else if (legend.length == 0 && seriesCount > 1) { for (i = 0; i < seriesCount; i++) { m[i] = i; colors[i] = colorList[i]; } } else { for (i = 0; i < legend.length; i++) { colors[i] = colorList[i % Object.keys(colorList).length]; } } legend.each(function(i) { if ($(this).css("fill-opacity") == 1) { m[i] = counter; r[counter] = i; counter += 1; } else { m[i] = -1; } }) return { chart: chart, legend: legend, colors: colors, m: m, r: r }; } function drawColors(id, colorList) { var data = prepColors(id, colorList), chart = data.chart, colors = data.colors, m = data.m; for (var i in colors) { chart.find(".nv-linesWrap .nv-groups .nv-series-" + m[i]).css({ "fill": colors[i], "stroke": colors[i] }); chart.find(".nv-barsWrap .nv-groups .nv-series-" + m[i] + " rect").css({ "fill": colors[i], "stroke": colors[i] }); chart.find(".nv-linePlusBar .nv-barsWrap .nv-bars rect").each(function(index) { $(this).css({ "fill": colors[0], "stroke": colors[0] }); }); chart.find(".nv-linePlusBar .nv-linesWrap .nv-groups .nv-series-0").css({ "fill": colors[1], "stroke": colors[1] }); chart.find(".nv-scatterWrap .nv-groups .nv-series-" + m[i]).css({ "fill": colors[i], "stroke": colors[i] }); chart.find(".nv-areaWrap .nv-area-" + m[i]).css({ "fill": colors[i], "stroke": colors[i] }); chart.find(".nv-pie .nv-slice").each(function(i) { $(this).css({ "fill": colors[i], "stroke": colors[i] }); }); } for (var i in opacities) { chart.find(".nv-linesWrap .nv-groups .nv-series-" + m[i]).css({ "opacity": opacities[i] }); chart.find(".nv-barsWrap .nv-groups .nv-series-" + m[i] + " rect").css({ "opacity": opacities[i] }); if (i == 0) { chart.find(".nv-linePlusBar .nv-barsWrap .nv-bars rect").each(function(index) { $(this).css({ "opacity": opacities[i] }); }); chart.find(".nv-linePlusBar .nv-linesWrap .nv-groups .nv-series-0").css({ "opacity": opacities[1] }); } chart.find(".nv-scatterWrap .nv-groups .nv-series-" + m[i]).css({ "opacity": opacities[i] }); chart.find(".nv-areaWrap .nv-area-" + m[i]).css({ "opacity": opacities[i] }); chart.find(".nv-pie .nv-slice").each(function(i) { $(this).css({ "opacity": opacities[i] }); }); } for (var i in lineDashes) { chart.find(".nv-linesWrap .nv-groups .nv-series-" + m[i]).css({ "stroke-dasharray": lineDashes[i] }); } chart.find(".nv-legendWrap .nv-series .nv-legend-symbol").each(function(i) { $(this).css({ "fill": colors[i], "stroke": colors[i] }); }) } function onMouseMove(id, colorList) { var chart = $("#" + id); $(chart).mousemove(function(event) { var data = prepColors(id, colorList), legend = data.legend, colors = data.colors, r = data.r, m = data.m, //seriesLength = $("html").find(".nvtooltip table .legend-color-guide").length - 1, isAreaLength = isArea = chart.find(".nv-area").length, isBarLength = chart.find(".nv-barsWrap").length, isLineLength = chart.find(".nv-linesWrap").length; //console.log(data) var colorsToFill = []; $("html").find(".nvtooltip table .legend-color-guide").each(function(i) { // if (colors[i] != "undefined"){ // colorsToFill.push(colors[i]); // console.log(colorsToFill) // } // console.log(colorsToFill[i]) if (legend.length == 0) { //console.log(colors[i]); $(this).find("div").css({ "background-color": colors[i] }); } else if (isLineLength > 0 && isBarLength > 0) { if ($(this).closest(".nvtooltip")[0].textContent.includes("right axis")) { $(this).find("div").css({ "background-color": colors[1] }); } else { $(this).find("div").css({ "background-color": colors[0] }); } } else if (isBarLength > 0) { $(this).find("div").css({ "background-color": colors[m[i]] }); } else if (isAreaLength > 0) { $(this).find("div").css({ "background-color": colors[isAreaLength - i - 1] }); } else { $(this).find("div").css({ "background-color": colors[i] }); } }) var sliceColor = chart.find(".nv-pie .nv-slice.hover").css("fill"); chart.find(".nvtooltip table .legend-color-guide div").css("background-color", sliceColor) }) $(chart).mouseleave(function() { $("html").find(".nvtooltip table .legend-color-guide").remove(); }) } setInterval(function() { charts.forEach(function(c) { drawColors(c, colors) }) }, 500) charts.forEach(function(c) { onMouseMove(c, colors); }) } </script>
{{ dataSourceName(params.queryId) }}

The dataset is too large to view in browser

Export

Looks like something went wrong with your query.

{{ DS.queryRuns[params.queryId].errorMessage }}
This query was cancelled