The Show All setting on dashboard controls

Variables

When you set a Dropdown control in a Chartio dashboard to Show All on the empty state, you are telling the chart’s query to apply a filter of WHERE 1=1. Ergo, you are telling the chart’s query not to filter anything.

In this example, we created a Dropdown control by clicking Add Control in the sidebar of the dashboard and selecting Dropdown. This example filters a subset of marketing campaigns that have happened within the date range.

Filtering

In the chart that this control affects, there is the option Print. This is because the chart’s query is sending WHERE 1=1 into the WHERE clause.

SELECT “Marketing”.“description” AS “Description”,SUM(“Marketing”.“cost”) AS “Total sum of Cost”FROM “public”.“marketing” AS “Marketing”WHERE (1 = 1)GROUP BY “Description”ORDER BY “Description” ASCLIMIT 1000;

Once an item (or items) are selected from the Dropdown, the query looks different:

SELECT “Marketing”.“description” AS “Description”,SUM(“Marketing”.“cost”) AS “Total sum of Cost”FROM “public”.“marketing” AS “Marketing”WHERE (“Marketing”.“description” IN (‘Event’, ‘Adwords’, ‘Web’, ‘Sales’))GROUP BY “Description”ORDER BY “Description” ASCLIMIT 1000;

The issue is that when Show All, the query is not passing through all the items; instead, the chart does not filter anything.


Related Variables Help Articles

See more