Report not found

There was a problem finding this report.
Word share by sex and group
November 8, 2016 · Refreshed over 2 years ago

Collaborators

Run History
WITH female_words AS( SELECT e.id, e.name, SUM(word_count) AS words FROM modeanalytics.westworld_lines l JOIN modeanalytics.westworld_episodes e ON l.episode_id = e.id JOIN modeanalytics.westworld_characters c ON c.id = l.character_id AND c.sex = 'female' GROUP BY 1,2 ), human_words AS( SELECT e.id, e.name, SUM(word_count) AS words FROM modeanalytics.westworld_lines l JOIN modeanalytics.westworld_episodes e ON l.episode_id = e.id JOIN modeanalytics.westworld_characters c ON c.id = l.character_id AND c.is_human IS TRUE GROUP BY 1,2 ), total AS( SELECT l.episode_id, SUM(word_count) AS words FROM modeanalytics.westworld_lines l GROUP BY 1 ) SELECT female_words.id AS episode_id, female_words.name, round(100*female_words.words / total.words::float8) AS perc_words_female, CASE WHEN (female_words.words / total.words::float8) < .5 THEN round(100*(1 - (female_words.words / total.words::float8) )) || '% male' ELSE round(100*female_words.words / total.words::float8) || '% female' END AS perc_words_male, round(100*human_words.words / total.words::float8) AS perc_words_human_num, CASE WHEN (human_words.words / total.words::float8) < .5 THEN round(100*(1 - (human_words.words / total.words::float8) )) || '% host' ELSE round(100*human_words.words / total.words::float8) || '% human' END AS perc_words_human FROM female_words JOIN human_words ON female_words.id = human_words.id JOIN total ON female_words.id = total.episode_id ORDER BY 1 DESC
WITH female_words AS( SELECT e.id, e.name, SUM(word_count) AS words FROM modeanalytics.westworld_lines l JOIN modeanalytics.westworld_episodes e ON l.episode_id = e.id JOIN modeanalytics.westworld_characters c ON c.id = l.character_id AND c.sex = 'female' GROUP BY 1,2 ), human_words AS( SELECT e.id, e.name, SUM(word_count) AS words FROM modeanalytics.westworld_lines l JOIN modeanalytics.westworld_episodes e ON l.episode_id = e.id JOIN modeanalytics.westworld_characters c ON c.id = l.character_id AND c.is_human IS TRUE GROUP BY 1,2 ), total AS( SELECT l.episode_id, SUM(word_count) AS words FROM modeanalytics.westworld_lines l GROUP BY 1 ) SELECT female_words.id AS episode_id, female_words.name, round(100*female_words.words / total.words::float8) AS perc_words_female, CASE WHEN (female_words.words / total.words::float8) < .5 THEN round(100*(1 - (female_words.words / total.words::float8) )) || '% male' ELSE round(100*female_words.words / total.words::float8) || '% female' END AS perc_words_male, round(100*human_words.words / total.words::float8) AS perc_words_human_num, CASE WHEN (human_words.words / total.words::float8) < .5 THEN round(100*(1 - (human_words.words / total.words::float8) )) || '% host' ELSE round(100*human_words.words / total.words::float8) || '% human' END AS perc_words_human FROM female_words JOIN human_words ON female_words.id = human_words.id JOIN total ON female_words.id = total.episode_id ORDER BY 1 DESC
<link rel="stylesheet" href="https://mode.github.io/alamode/alamode.min.css"> <script src="https://mode.github.io/alamode/alamode.min.js"></script> <style> body { background: #f0f0f0 !important; } .chart { background-color: #f0f0f0; border: none; } .mode-embed .mode-object { border: none; background: #f0f0f0; } .js-table-container { background-color: #f0f0f0; } </style> <div class="mode-header embed-hidden"> <h1>{{ title }}</h1> <p>{{ description }}</p> </div> <div class="mode-grid container"> <div class="row" data-row-height="small"> <div class="col-md-7"> <mode-python id="python_3777f3150cba" options="python_options"></mode-python> </div> <div class="col-md-5"></div> </div> <div class="row"> <div class="col-md-7"> <mode-python id="python_1019ddae5c12" options="python_options"></mode-python> </div> <div class="col-md-5"></div> </div> </div> <script> alamode.resizeChartHeight({ chart: "python_3777f3150cba", height: 350 }) alamode.resizeChartHeight({ chart: "python_1019ddae5c12", height: 350 }) </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