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.
“Date bucket” controls let you change the time bucket used for connected charts.
Setting up a “Date bucket” control requires two main steps:
Create the “Date bucket” control for your dashboard.
Connect the “Date bucket” control to a chart.
To add a “Date bucket” control to your dashboard:
Open the dashboard where you want to add the “Date bucket” control.
Select Add control > Date bucket from the dashboard sidebar. A pop-up will appear for you to configure the control’s settings.
Optionally, change the Name of the control.
For Default value, select the default time bucket to use when opening the dashboard.
Select Add.
Place the newly created “Date bucket” control anywhere on your dashboard.
After you’re created your “Date bucket” 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.
You can also connect controls in other Visual SQL steps. Learn more about connecting controls outside of a query.
To connect a “Date bucket” 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. You’ll need a chart containing a date or datetime column.
Edit the visual mode query containing the date or datetime column.
Open the column’s aggregation menu then select then name of your “Date bucket” 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.
Connect a “Date bucket” control in your SQL mode query by using the following format to use its dashboard variable: {DATE_BUCKET_NAME.BUCKET('"table_name"."column_name"')}
Replace DATE_BUCKET_NAME with name of your control.
Make sure to wrap the table-column reference in single quotes.
If you’re querying the Atlassian Data Lake, change the double quotes (") to backticks (`).
In your GROUP BY clause, use the same column alias provided in your SELECT statement.
Here’s an example of how you might connect a “Date bucket” control to the created date of Jira issues:
1
2
3
SELECT {DATE_BUCKET_NAME.BUCKET('`Jira Issue`.`created_at`')} AS `Date Bucket of Created At`
FROM `jira_issue` AS `Jira Issue`
GROUP BY `Date Bucket of Created At`
To get the value of your “Date bucket” control, use {DATE_BUCKET_NAME}. The value is returned as an all-lowercase string (for example, day, week, year, etc.). This is useful if you want to perform different calculations that depend on the current value of the “Date bucket” 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, there are two ways you can check for all charts that are connected to the control.
One option is to:
Hover over the control.
Select its More actions () menu > Highlight connections.
The other option is to:
Select Settings from the dashboard sidebar.
Go to the Controls tab.
Select Highlight connections.
Both options highlight all elements on the dashboard that are connected to that particular control.
Was this helpful?