I used the Atlassian AI to write a query, then copied that query code into a new chart. Then I tried to add a control but it won't connect to the chart and I don't know enough SQL to add a control in SQL. How can I figure this out?
Hello Dylan!
I am Nayan from the Atlassian Analytics team, happy to help!
The control variables need to be added to the where clause in your SQL query. Here is an example of how to add a calendar control to charts in SQL mode:
SELECT COUNT(DISTINCT `Issue`.`issue_id`) AS `Count of unique Issue ID`
FROM `jira_issue` AS `Issue`
WHERE `Issue`.`created_at` BETWEEN {CALENDAR_NAME.START} AND {CALENDAR_NAME.END}
Here, {CALENDAR_NAME.START} and {CALENDAR_NAME.END} are the variable controls that we have added in our SQL query to connect the chart with our control. Now, when we select a date range on the Dashboard, these values will be fetched and the chart will be dynamically filtered on the basis on the calendar control values.
I'd also recommend checking the below links to understand how controls work and how to add them to existing charts:
- Document - https://support.atlassian.com/analytics/docs/use-variable-controls-for-interactive-filtering/ (Every control type has a section called In a SQL mode query where you can find how to add the controls in SQL mode.)
- Dashboard controls Demo Video - https://www.youtube.com/watch?v=dM0cdIqzvxY
Let me know if this helps.
Regards,
Nayan
This definitely helped, Nayan! Thanks so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.