Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to declare and set a variable using SQL editor for a chart in Jira Analytics ?

Gregory CHAZALON
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2025

Hello,

My context is a creating a custom chart within Jira Analytics.

I would like to use a variable within my SQL statement, in order to keep that statement more generic and reusable for other charts.

I have read the Databricks documentation (if I have understood it well, Jira Analytics is based on Databricks). 

I have tried to use the statement 'DECLARE VAR myvar ..;'  plus the statement 'SET VAR myvar=...:' but I got syntax error from parser.

I guess that type of statement is not supported yet by Analytics. If it is the case, how can I declare a variable ?

To be precise, I have already used a Common Table Expression (CTE) in my SQL, and I cannot use more than one (which I find weird by the way) to solve this.

Any hints/tips ?

Thanks !

1 answer

0 votes
Jaime Escribano
Contributor
May 7, 2025

Hi Gregory! Welcome to the community!

 

You are completly right that Analytics is built on top of Databricks. Sadly declaring variables the way you attempted is not supported 😣

 

 

What you might wanna do is declare variables at the dashboard or global level as detailed in this documentation: https://support.atlassian.com/analytics/docs/use-and-edit-variables/

 

You can also learn the details about variables here: https://support.atlassian.com/analytics/docs/what-are-variables/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events