• Products
  • Documentation
  • Resources

Set up a “Hidden variable” control

“Hidden variable” controls let you set filter values that are not directly accessible on your dashboard.

Setting up a “Hidden variable” control requires two main steps:

  1. Create the “Hidden variable” control for your dashboard.

  2. Connect the “Hidden variable” control to a chart.

Create a “Hidden variable” control

To add a “Hidden variable” control to your dashboard:

  1. Open the dashboard where you want to add the “Hidden variable” control.

  2. Select Add control > Hidden variable from the dashboard sidebar. A pop-up will appear for you to configure the control’s settings.

  3. Edit the control’s settings as needed. Go to the next section to learn more about “Hidden variable” settings.

  4. Select Add.


“Hidden variable” control settings

You can edit the following settings for your “Hidden variable”:

Name

The name of the control

Data type

The data type of your control:

  • Date range

  • Date

  • Text

  • Number

Default start and end dates

Only available when the Data type is Date range

Use fixed dates, or use a combination of relative date variables and date and time functions for dynamic filtering.

Multiple values

Only available when the Data type is Number or Text

Specifies if the control is a list of numbers or strings. When this is selected, you can add multiple default values.

Default values

Set default values to select when you open the dashboard. We’ll turn the listed values into a comma-separated list. Values for text lists are wrapped in quotes; values for numeric lists are not.


Connect a “Hidden variable” control to a chart

After you’ve created your “Hidden variable” control, you’ll need to connect it to a chart to start using it to filter. Connect it to a chart by using its corresponding dashboard variable in a query.

In a visual mode query

To connect a “Hidden variable” control to a chart using a visual mode query:

  1. Open the chart editor by creating a new chart or editing an existing chart on the dashboard.

  2. In the “Filters” section of your visual mode query:

    1. Add the column you want the control to filter. It must have the same data type as your “Hidden variable” control.

    2. Select the appropriate filter operator.

    3. Provide the dashboard variable of your control.

  3. Select Run query. The result table will update with the new filter applied to the data.

  4. Select Save to dashboard to save the chart.

Using a Hidden variable control to filter for a specific issue number in a visual mode query.

In a SQL mode query

The syntax for connecting a “Hidden variable” control in your SQL mode query varies depending on the data type you select in the control’s settings:

  • Date or date range

  • Single value

  • Multi-select

Date or date range “Hidden variable”

Just like “Calendar” and “Date slider” controls, you can reference the control’s start and end date properties using the following syntaxes:

  • If the “Data type” of your control is Date, use {HIDDEN_VARIABLE_NAME}

  • If the “Data type” of your control is Date range, use {HIDDEN_VARIABLE_NAME.START} and {HIDDEN_VARIABLE_NAME.END} for the start and end dates, respectively.

  • Replace HIDDEN_VARIABLE_NAME with the name of your control.

Here’s an example of how you might get the total number of Jira issues created between the selected dates of a “Hidden variable” control:

1 2 3 SELECT COUNT(DISTINCT "Jira Issue"."issue_id") AS "Count of distinct Issue Id" FROM "jira_issue" AS "Jira Issue" WHERE "Jira Issue"."created_at" BETWEEN {HIDDEN_VARIABLE_NAME.START} AND {HIDDEN_VARIABLE_NAME.END};

Single value “Hidden variable”

If Multi-value is deselected, the syntax is simple: {HIDDEN_VARIABLE_NAME}. Replace HIDDEN_VARIABLE_NAME with the name of your control.

For “Hidden variable” controls whose data type is text, we wrap the values in single quotes when they’re passed to a query. To remove the single quotes, append .RAW to the control name: {HIDDEN_VARIABLE_NAME.RAW}

Here’s an example of how you might get the total number of Jira issues where the project type is equal to the selected “Hidden variable” value:

1 2 3 4 5 SELECT COUNT(DISTINCT "Jira Issue"."issue_id") AS "Count of distinct Issue Id" FROM "jira_issue" AS "Jira Issue" INNER JOIN "jira_project" AS "Jira Project" ON "Jira Project"."project_id" = "Jira Issue"."project_id" WHERE "Jira Project"."project_type" = {HIDDEN_VARIABLE_NAME}

Multi-select “Hidden variable”

If Multi-value is selected, use the following syntax:

  • to include data with the selected “Hidden variable” values: {HIDDEN_VARIABLE_NAME.IN('"table_name"."column_name"')}

  • to exclude data with the selected “Hidden variable” values: {HIDDEN_VARIABLE_NAME.NOT_IN('"table_name"."column_name"')}

Replace HIDDEN_VARIABLE_NAME with the name of your control, and make sure to wrap the table-column reference in single quotes.

Here’s an example of how you might get the total number of Jira issues for all project types selected in the “Hidden variable” control:

1 2 3 SELECT COUNT(DISTINCT "Jira Issue"."issue_id") AS "Count of distinct Issue Id" FROM "jira_issue" AS "Jira Issue" WHERE "Jira Issue"."created_at" BETWEEN {HIDDEN_VARIABLE_NAME.START} AND {HIDDEN_VARIABLE_NAME.END};

Conversely, here’s an example of how you might get the total number of Jira issues for all project types not selected in the “Hidden variable” control:

1 2 3 4 5 SELECT COUNT(DISTINCT "Jira Issue"."issue_id") AS "Count of distinct Issue Id" FROM "jira_issue" AS "Jira Issue" INNER JOIN "jira_project" AS "Jira Project" ON "Jira Project"."project_id" = "Jira Issue"."project_id" WHERE "Jira Project"."project_type" = {HIDDEN_VARIABLE_NAME}

Verify your chart is connected to the control

To make sure you’ve properly connected your chart to the control, you could verify this by updating the values of the control and seeing if your connected chart filters accordingly.

Alternatively, you can check for all charts that are connected to the control by doing the following:

  1. Select Settings from the dashboard sidebar.

  2. Go to the Controls tab.

  3. Select Highlight connections.

This highlights all elements on the dashboard that are connected to that particular control.

Additional Help