A simple ods-aggregation results
Count the number of record of a dataset, here : the number of US hospitals
Dataset in use: us-hospitals
(See it on userclub domain)
Fields in use: none: count function
<div class="row">
<div class="col-sm-offset-4 col-sm-4">
<ods-dataset-context context="ushospitals"
ushospitals-domain="userclub"
ushospitals-dataset="us-hospitals">
<!-- KPI box component -->
<div class="kpi-card">
<i class="kpi-icon fa fa-hospital-o" aria-hidden="true"></i>
<p class="kpi-title"
ods-aggregation="count"
ods-aggregation-context="ushospitals"
ods-aggregation-function="COUNT">
{{ count | number }}
</p>
<p class="kpi-description">
Number of hospitals
</p>
</div>
</ods-dataset-context>
</div>
</div>
/* Variables & Shared classes
========================================================================== */
:root {
--secondary-color: #142E7B;
}
.row-equal-height {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-bottom: 20px;
}
/* Fix for early content wrapping in Safari*/
.row-equal-height:before,
.row-equal-height:after {
content: normal;
}
/* KPI Card
========================================================================== */
.kpi-card {
background-color: var(--boxes-background);
height: 100%;
padding: 39px;
border-radius: 4px;
margin-bottom: 20px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
text-align: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
text-align: center;
}
.kpi-icon {
color: var(--highlight);
color: var(--secondary-color);
font-size: 4rem;
margin-top: 0;
margin-bottom: 13px;
max-width: 100%;
}
.kpi-title {
font-weight: normal;
color: var(--highlight);
font-size: 3.2rem;
margin-top: 0;
margin-bottom: 13px;
max-width: 100%;
}
.kpi-description {
color: var(--text);
font-size: 1rem;
line-height: 1.5;
font-weight: normal;
margin-top: 0;
margin-bottom: 0;
max-width: 100%;
}
.kpi-description-detail {
opacity: 0.9;
font-style: italic;
font-size: 0.9em;
margin-top: 0.8em;
}