Documentation Visual SQL (beta)

Visual SQL Dashboard Controls

Dashboard Controls are filters you can set on a dashboard-wide basis, allowing you to apply filters to multiple charts simultaneously.

Using a Dashboard Control is a two-part process. First, you’ll create the Control, then you’ll connect it to one or more charts.


Dashboard Controls
Calendar Date Bucket
Date Slider Dropdown
Hidden Variable Range Input
Text Input

Calendar

Calendar Date Control

Create a Calendar

Click Add Control from the dashboard sidebar menu and select Calendar. A modal will pop up for you to choose your Calendar Control settings.

For Data type, choose whether you want to filter your charts on a single Date or a Date Range.

Edit the Default value(s) using a custom date, or a Relative Date as needed.

Add a Calendar Control to filter your charts by time

Connect a Calendar to your chart

Find the chart you want to connect to your Calendar and open it in Visual SQL. Add the date column you want to filter by to the Filters section. Choose your filter type (you’ll probably want to use between or between and including), then type {CALENDAR_NAME.START} and {CALENDAR_NAME.END} for the start and end dates, respectively. Replace CALENDAR_NAME with your Control name.

Note: You’ll need to use the same .START and .END syntax when referencing Calendars in SQL Mode queries.

Connect a Calendar to your chart by adding it as a filter


Date Bucket

Date Bucket

Create a Date Bucket

Click Add Control from the dashboard sidebar menu and select Date Bucket. A modal will pop up for you to customize your Control settings.

Rename the Control if desired, and select your default bucket value.

Add Date bucket selector

Connect a Date Bucket to a chart

Once you’ve created your Date Bucket Control, open a chart you’d like to connect to your Date Bucket. You’ll need a chart containing a date column.

Edit the Query containing the date/datetime column and open the column’s aggregation menu and select your Date Bucket Control.

Note: Quarter bucketing is not supported by Google Analytics.

Using SQL Mode? Check out how to reference Date Buckets in SQL Mode queries.

Connect a Date Bucket to your chart by selecting it from the aggregation menu


Date Slider

Date Slider Dashboard Control

Create a Date Slider

Click Add Control from the dashboard sidebar menu and select Date Slider. You’ll be redirected to Visual SQL where you’ll add a date column to the Columns section, click Run Query then edit it as needed. You can also add a numeric column to display the Date Slider in 2D. Then, set the default date range using fixed or Relative Dates and click Save to Dashboard once completed.

Create a Date Slider to filter using date ranges

Connect a Date Slider to your chart

Find the chart you want to connect to your Date Slider and open it in Visual SQL. Add the date column you want to filter by to the Filters section. Choose your filter type (you’ll probably want to use “between” or “between and including”), then select {DATE_SLIDER_NAME.START} and {DATE_SLIDER_NAME.END} for the start and end dates, respectively. Replace DATE_SLIDER_NAME with your Control name.

Note: You’ll need to use the same .START and .END syntax when referencing Date Sliders in SQL Mode queries.

If your Date Slider is grouped by hour or minute, select the between filter in the Date Slider Using Hour or Minute section.

Connect a Date Slider to your chart by adding it as a filter


Dashboard Dropdown Control

Create a Dropdown

Click Add Control from the dashboard sidebar menu and select Dropdown. You’ll be redirected to Visual SQL. Add the column you want to use for your category. The values in that column will populate a dropdown menu, which you can use to filter your charts.

Create a dashboard Dropdown to filter your charts

  • Data type: Select the data type for your Dropdown’s results (Text, Number, Boolean, Date).
  • Multi-select: Check this checkbox to allow filtering by multiple values at once. If selecting multi-select, be sure your connected chart’s filter is “is one of” and not “equals” or “like”.
  • Empty state: When no values are selected in the Dropdown, you can either Show all rows in the attached charts or Show none.
  • Initial value(s): Check this checkbox to set custom filter value(s) on load.

Connect a Dropdown to a chart

Open the chart you’d like to connect to your Dropdown in Visual SQL. Add the column you want to filter your dataset on to the Filters section, select the filter type, and select your Control name.

A couple of things to keep in mind:

  • Your Dropdown must have the same data type as the column you’re filtering on.
  • Your filter type must match the type of Dropdown you’re using. For example, if you’ve left Multi-select unchecked in the Dropdown’s settings, make sure you don’t use filter type “is one of”.

Using SQL Mode? Check out how to reference multi-select Dropdowns in SQL Mode queries.

Connect your Dropdowns to your charts by adding them as filters


Hidden Variable

Create a Hidden Variable

Click Add Control from the dashboard sidebar menu and select Hidden Variable. A modal will pop up for you to customize your Control settings.

For Date Range or a single Date, you can either set a specific date or choose a Relative Date Variable such as the last 30 days.

To set a list of numbers or strings as your Control, select Is List, and click Add Value for each additional list item you’d like to add. We’ll translate this to a comma-separated list. Text lists will be quoted, numerical lists will not.

Add a hidden variable which can filter your charts without being visible on the dashboard

Connect a Hidden Variable to your chart

Open the chart you’d like to connect to your Hidden Variable in the Visual SQL. Add the column you want to filter your dataset on to the Filters section, select the filter type, and select your Control name. You’ll need to ensure your Hidden Variable has the same data type as the column you’re filtering on.

Using SQL Mode? Check out how to reference Hidden Variables in SQL Mode queries if it’s a date type, single value, or list type.

Connect a Hidden Variable to your chart by adding it as a filter


Range Input

Add a range input to filter by a numeric range

Create a Range Input

Click Add Control from the dashboard sidebar menu and select Range Input. A modal will pop up for you to customize your Control settings.

Choose the Min and Max for your range, edit Precision if you’d like to include decimal values, and set the Default values that will be selected when the dashboard is first loaded.

Range Input Control

Connect a Range Input to your chart

Open the chart you’d like to connect to your Range Input in Visual SQL. Add the numeric column you want to filter your dataset on to the Filters section, select between and including for the filter type, then select {RANGE_INPUT_NAME.START} and {RANGE_INPUT_NAME.END} for the beginning and end of the range, respectively. Replace RANGE_INPUT_NAME with your Control name.

Note: You’ll need to use the same .START and .END syntax when referencing Range Inputs in SQL Mode queries.

Add a Range Input to your chart by adding it as a filter


Text Input

Dashboard Text Input

Create a Text Input

Click Add Control from the dashboard sidebar menu and select Text Input. A modal will pop up for you to customize your Control settings.

Check Multi-value if you’d like to filter your charts by multiple values. When selected, choose whether all results (Show all) or no results (Show none) are displayed when no filter value is selected.

The Default Value will be used to filter your charts when no value is typed into the input box. This field is optional - leave it blank for an empty result set by default.

Add a Text Input to filter using numeric or text values

Partial string matching

The Text Input Control requires an exact string match. To search by partial strings, select filter type “LIKE” in Visual SQL, and use percent signs around your search string as needed. For example, to filter by names that start with “A”, set your chart filter to filter by values ‘like’ your input Control (e.g., Name like {TEXT-INPUT-NAME}), and enter A% into the Text Input widget on your dashboard.

The input widget encloses the search value in single quotes, and therefore does not allow multiple input values at once.

For the Default Start and Default End date, you can either set a specific date or choose a Relative Date Variable such as the last 30 days.

Connect a Text Input to your chart

Open the chart you’d like to connect to your Text Input in Visual SQL. Add the column you want to filter your dataset on to the Filters section, select the filter type, and type your Control name wrapped in curly braces. You’ll need to ensure your Text Input has the same data type as the column you’re filtering on. If you selected Multi-value when creating your text input, be sure to use filter type “is one of”, not “equals”.

Using SQL Mode? Check out how to reference Text Inputs in SQL Mode queries.

Connect a Text Input to your chart by adding it as a filter