Combine columns in Visual SQL
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
There may be scenarios where you want to combine values from multiple columns to create your desired chart. Since Visual SQL steps recognize standard SQLite expressions, you can use the ||
operator, which allows you to concatenate (combine) values. You can also add additional text to the new column by including the text in single quotes.
In this example, we want to combine the “First Name” and “Last Name” column to create a column that combines the two values.

To combine the columns in Visual SQL:
Select the “Formula column” step above the result table and choose Custom as the formula type.
Enter the following formula to combine the two columns with a space in between the two column values:
1
"First Name"||' '||"Last Name"
Be sure to wrap column names in double quotes and static string in single quotes in your custom formula.

Solution
Combining columns with null values
When using a “Formula column” step to combine two columns, the combined column will be blank if one of the columns is null. This is because concatenation ignores a null column and doesn’t show it in the result.

To address this, you can use a CASE
statement formula in an “Apply formula” step prior to combining the columns.
For this example, if there are any null values for “Last Name”, we want to fill it with the string ' '. Here’s what that CASE
statement would look like:
1
CASE WHEN "Last Name" IS NULL THEN ' ' ELSE "Last Name" END

Now any null values in the “Last Name” column are filled with a blank space. This enables us to combine the values in all the rows when combining columns.

Was this helpful?