Get started with Atlassian Analytics
Learn how to add Atlassian Analytics to a site and understand what you need to query data and create charts.
“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:
Create the “Hidden variable” control for your dashboard.
Connect the “Hidden variable” control to a chart.
To add a “Hidden variable” control to your dashboard:
Open the dashboard where you want to add the “Hidden variable” control.
Select Add control > Hidden variable from the dashboard sidebar. A pop-up will appear for you to configure the control’s settings.
Edit the control’s settings as needed. Go to the next section to learn more about “Hidden variable” settings.
Select Add.
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.
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.
To connect a “Hidden variable” control to a chart using a visual mode query:
Open the chart editor by creating a new chart or editing an existing chart on the dashboard.
In the “Filters” section of your visual mode query:
Add the column you want the control to filter. It must have the same data type as your “Hidden variable” control.
Select the appropriate filter operator.
Provide the dashboard variable of your control.
Select Run query. The result table will update with the new filter applied to the data.
Select Save to dashboard to save the chart.
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
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};
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}
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}
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:
Select Settings from the dashboard sidebar.
Go to the Controls tab.
Select Highlight connections.
This highlights all elements on the dashboard that are connected to that particular control.
Was this helpful?