Tabulate confirmed cases, across gender and age in Canada.

GET http://covid19.richdataservices.com/rds/api/query/ca/ca_statcan_cases/tabulate?dims=gender,age_group&measure=COUNT:COUNT(*)&format=amcharts&inject=true&orderby=gender ASC, age_group DESC

Here, we are using a dataset from Statistics Canada that contains record level data about COVID-19 cases. Each row (record) in the data file represents a single reported confirmed case. Data like this can be more interesting, but also larger, more difficult to parse, and requires a bit of extra work to make meaningful comparisons.

By specifying amCharts as our format, we can plug this request into our JavaScript code and cut out all of the data manipulation we would otherwise need to deal with, as RDS takes care of the calculations and formatting. Check out the full code for this and other data visualizations on our RDS-JavaScript examples page.

In this visualization, we are comparing the number of confirmed cases (indicated by the shade of blue defined on the scale) for each gender (the four reported categories on the horizontal axis) and age group (categories defined on the vertical axis). You can also see this query in the Tabulation Engine.

plotlyHeatmap

Data as of 5/27/2020

Request Params

KeyDatatypeRequiredDescription
dimsstringOur dimensions are gender and age group, creating the axis categories for the heatmap
measurestringCalculate the count of respondents that fall into each age group and gender and assign it to variable named "COUNT"
formatstringOur desired charting library. Other available formats are PLOTLY_BAR, PLOTLY_BOXPLOT, PLOTLY_BUBBLE, PLOTLY_HIST, PLOTLY_PIE, GCHART
injectbooleanInject the code label in place of the code value - so we will see "Male, Female, Non-binary, Not stated." instead of "1, 2, 3, 9."
orderbystringOrder by gender ascending order, and age group descending, creating the right order for our heatmap to display.

RESPONSES

status: OK

{"dataProvider":[{"gender":"Male","age_group":"Not stated","COUNT":194},{"gender":"Male","age_group":"80 years or older","COUNT":1928},{"gender":"Male","age_group":"70 to 79 years","COUNT":1497},{"gender":"Male","age_group":"60 to 69 years","COUNT":2199},{"gender":"Male","age_group":"50 to 59 years","COUNT":2684},{"gender":"Male","age_group":"40 to 49 years","COUNT":2688},{"gender":"Male","age_group":"30 to 39 years","COUNT":2508},{"gender":"Male","age_group":"20 to 29 years","COUNT":2066},{"gender":"Male","age_group":"0 to 19 years","COUNT":896},{"gender":"Female","age_group":"Not stated","COUNT":200},{"gender":"Female","age_group":"80 years or older","COUNT":3991},{"gender":"Female","age_group":"70 to 79 years","COUNT":1427},{"gender":"Female","age_group":"60 to 69 years","COUNT":2164},{"gender":"Female","age_group":"50 to 59 years","COUNT":3449},{"gender":"Female","age_group":"40 to 49 years","COUNT":3105},{"gender":"Female","age_group":"30 to 39 years","COUNT":2725},{"gender":"Female","age_group":"20 to 29 years","COUNT":2500},{"gender":"Female","age_group":"0 to 19 years","COUNT":936},{"gender":"Non-binary","age_group":"80 years or older","COUNT":1},{"gender":"Non-binary","age_group":"70 to 79 years","COUNT":2},{"gender":"Non-binary","age_group":"60 to 69 years","COUNT":1},{"gender":"Non-binary","age_group":"50 to 59 years","COUNT":4},{"gender":"Non-binary","age_group":"40 to 49 years","COUNT":2},{"gender":"Non-binary","age_group":"30 to 39 years","COUNT":2},{"gender":"Non-binary","age_group":"0 to 19 years","COUNT":2},{"gender":"Not stated","age_group":"Not stated","COUNT":28},{"gender":"Not stated","age_group":"80 years or older","COUNT":104},{"gender":"Not stated","age_group":"70 to 79 years","COUNT":25},{"gender":"Not stated","age_group":"60 to 69 years","COUNT":17},{"gender":"Not stated","age_group":"50 to 59 years","COUNT":14},{"gender":"Not stated","age_group":"40 to 49 years","COUNT":14},{"gender":"Not stated","age_group":"30 to 39 years","COUNT":12},{"gender":"Not stated","age_group":"20 to 29 years","COUNT":7},{"gender":"Not stated","age_group":"0 to 19 years","COUNT":5}]}