What Show All Actually Means


#1

Plain and simple, “Show all” does not mean “Show all” until there is an ALL to show.

When you set a dropdown filter in a Chartio Dashboard to “Show All” on the empty state, what you are actually telling the chart’s query is to apply a filter of “WHERE 1=1”. In simpler terms you are telling the chart’s query to not filter anything…at all.

Using the Chartio Demo Source; we have this demonstration:

First, we have a calendar range filter that selects a subset of Marketing Campaigns that happened within the date range.


You will notice in this dropdown the only options you are going to be able to choose from are “Adwords”, “Event”, “Sales”, and “Web”.


But…you will also notice in the chart that this filter affects, there is an extra 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” ASC
LIMIT 1000;

But once an item, or a few, is 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” ASC
LIMIT 1000;

The issue is basically this:

When show all is selected, this is not passing through all the items (e.g. anything in the dropdown list) but rather it is causing the chart to not filter any anything at all.