Report not found

There was a problem finding this report.
Playoff Length - Chart 3
April 30, 2014 · Refreshed over 5 years ago
Description
Full blog post: http://blog.modeanalytics.com/are-the-playoffs-taking-forever/

Collaborators

Run History
SELECT AVG(CASE WHEN x.league = 'nba' THEN x.full_length_of_playoffs ELSE NULL END)/365::FLOAT AS "...during the NBA Playoffs", 52/365::FLOAT AS "...a Monday" FROM ( SELECT z.league, CASE WHEN LENGTH(z.season) = 5 THEN CASE WHEN LEFT(RIGHT(z.season,2),1) IN ('0','1') THEN CONCAT('20',RIGHT(z.season,2))::INT ELSE CONCAT('19',RIGHT(z.season,2))::INT END ELSE z.season::INT END AS season, EXTRACT('DAY' FROM z.pl_full_end - z.pl_full_start) AS full_length_of_playoffs FROM ( SELECT t.league, t.season, MIN(CASE WHEN t.game_type != 'regular_season' THEN t.date ELSE NULL END) AS pl_full_start, MAX(CASE WHEN t.game_type != 'regular_season' THEN t.date ELSE NULL END) AS pl_full_end FROM benn.professional_sports_game_log t WHERE t.date >= '1969-01-01' GROUP BY 1,2 ) z ) x WHERE x.season > 2005 AND (x.season != 1994 OR x.league != 'mlb') AND (x.season != 1982 OR x.league != 'nfl') AND (x.season != 1995 OR x.league != 'nhl') AND (x.season != 2005 OR x.league != 'nhl') AND (x.season != 2013 OR x.league != 'nhl') AND (x.season != 1999 OR x.league != 'nba') AND (x.season != 2012 OR x.league != 'nba') LIMIT 100
SELECT AVG(CASE WHEN x.league = 'nba' THEN x.full_length_of_playoffs ELSE NULL END)/365::FLOAT AS "...during the NBA Playoffs", 52/365::FLOAT AS "...a Monday" FROM ( SELECT z.league, CASE WHEN LENGTH(z.season) = 5 THEN CASE WHEN LEFT(RIGHT(z.season,2),1) IN ('0','1') THEN CONCAT('20',RIGHT(z.season,2))::INT ELSE CONCAT('19',RIGHT(z.season,2))::INT END ELSE z.season::INT END AS season, EXTRACT('DAY' FROM z.pl_full_end - z.pl_full_start) AS full_length_of_playoffs FROM ( SELECT t.league, t.season, MIN(CASE WHEN t.game_type != 'regular_season' THEN t.date ELSE NULL END) AS pl_full_start, MAX(CASE WHEN t.game_type != 'regular_season' THEN t.date ELSE NULL END) AS pl_full_end FROM benn.professional_sports_game_log t WHERE t.date >= '1969-01-01' GROUP BY 1,2 ) z ) x WHERE x.season > 2005 AND (x.season != 1994 OR x.league != 'mlb') AND (x.season != 1982 OR x.league != 'nfl') AND (x.season != 1995 OR x.league != 'nhl') AND (x.season != 2005 OR x.league != 'nhl') AND (x.season != 2013 OR x.league != 'nhl') AND (x.season != 1999 OR x.league != 'nba') AND (x.season != 2012 OR x.league != 'nba')
<style> body { font-family: Helvetica, Arial, sans-serif; font-size: 12px; text-align:center; } .bar { fill: steelblue; } .bar:hover { fill: brown; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } </style> <body> <div id="chart"> <h3>Days in the Year that Are...</h3> </div> <script> var margin = {top: 20, right: 20, bottom: 30, left: 40}, width = 400 - margin.left - margin.right, height = 200 - margin.top - margin.bottom; var x = d3.scale.ordinal() .rangeRoundBands([0, width], .1); var y = d3.scale.linear() .range([height, 0]); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left") .ticks(5, "%"); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); result = dataset.content x.domain(['...during the NBA Playoffs','...a Monday']); y.domain([0,.2]); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis); svg.append("g") .attr("class", "y axis") .call(yAxis); svg.selectAll(".bar") .data(['...during the NBA Playoffs','...a Monday']) .enter().append("rect") .attr("class", "bar") .attr("x", function(d) { return x(d); }) .attr("width", x.rangeBand()) .attr("y", function(d) { console.log(result[0]); return y(result[0][d]); }) .attr("height", function(d) { return height - y(result[0][d]); }); </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