--- title: Metric card example slug: n2sg3042 canonical_url: https://docs.coveo.com/en/n2sg3042/ collection: coveo-analytics source_format: adoc --- # Metric card example This article provides an example of a complete SQL query relating to a [metric](https://docs.coveo.com/en/263/) card. Metric cards can be found in a [dashboard](https://docs.coveo.com/en/256/) on the [**Reports**](https://platform.cloud.coveo.com/admin/#/orgid/usage/reports/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/reports/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/reports/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/reports/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/). The following image is that of a **Summary** dashboard: ![Summary dashboard showing activity keywords relevancy content gaps and device visits | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/summary-dashboard-example-1.png) The **Summary** dashboard contains [report cards](https://docs.coveo.com/en/267/), such as the following pie chart card: ![Pie chart showing visits by country | Coveo Platform](https://docs.coveo.com/en/assets/images/coveo-analytics/pie-chart-example.png) The SQL query corresponding to this card is the following: ```SQL WITH "cte_searches" AS ( SELECT "search_id", "origin_country", "visit_id", "custom_datas":"c_context_website"::string AS "website" FROM "COVEO"."ua"."searches_shared" WHERE CONVERT_TIMEZONE('UTC', 'America/New_York', "datetime") BETWEEN '2022-12-13 00:00:00.000'::TIMESTAMP_TZ AND '2023-01-12 23:59:59.999'::TIMESTAMP_TZ ), "cte_clicks" AS ( SELECT "search_id", "origin_country", "visit_id", "custom_datas":"c_context_website"::string AS "website" FROM "COVEO"."ua"."clicks_shared" WHERE convert_timezone('UTC', 'America/New_York', "datetime") BETWEEN '2022-12-13 00:00:00.000'::TIMESTAMP_TZ AND '2023-01-12 23:59:59.999'::TIMESTAMP_TZ ), "cte_customs" AS ( SELECT "last_search_id" AS "search_id", "origin_country", "visit_id", "custom_datas":"c_context_website"::string AS "website" FROM "COVEO"."ua"."custom_events_shared" WHERE convert_timezone('UTC', 'America/New_York', "datetime") BETWEEN '2022-12-13 00:00:00.000'::TIMESTAMP_TZ AND '2023-01-12 23:59:59.999'::TIMESTAMP_TZ ) SELECT COALESCE("cte_searches"."origin_country", "cte_clicks"."origin_country", "cte_customs"."origin_country") AS "Country" , COUNT(DISTINCT COALESCE("cte_searches"."visit_id", "cte_clicks"."visit_id", "cte_customs"."visit_id")) AS "Country - Visits" FROM "cte_searches" LEFT OUTER JOIN "cte_clicks" ON "cte_searches"."search_id" = "cte_clicks"."search_id" FULL OUTER JOIN "cte_customs" ON "cte_searches"."search_id" = "cte_customs"."search_id" WHERE coalesce("cte_searches"."website","cte_clicks"."website","cte_customs"."website") IN ('engineering','Engineering') GROUP BY "Country" ORDER BY "Country - Visits" DESC; ``` Results obtained after [running the query your Snowflake worksheet](https://docs.snowflake.com/en/user-guide/ui-snowsight-query#writing-queries-in-worksheets) are the following: ![summary-dashboard-example](https://docs.coveo.com/en/assets/images/coveo-platform/reader-account-result-example.png)