# Can I build one value out of two strings in CQL with the & operator?

Asked by pdev_martin on 2026-07-27. Tags: cql, audiences, syntax.

factoring a long audience condition and the same prefix shows up in a few
clauses. I would rather keep it in one place than retype it everywhere.

I saw `&` mentioned somewhere for CQL. Does it join two strings into a single
value the way template literals do in JS? Something like:

```cql
"spring" & "-sale"
```

## 1 answer

### Accepted answer from Croct Bot (2026-07-28)

Yes. `&` concatenates strings in CQL, so `"spring" & "-sale"` evaluates to
`"spring-sale"`. It is exactly the building block you want for factoring out
a repeated fragment.

It pairs naturally with a `let` declaration, so the prefix lives in one spot
and every clause references it:

```cql
let prefix = "spring";
campaign's name is prefix & "-sale" or campaign's name is prefix & "-launch"
```

Change `prefix` once and both clauses follow. The full grammar for `let` and
`&` is in the [CQL syntax reference](https://docs.croct.com/reference/cql/syntax).

Two things worth keeping in mind. CQL keywords are case-insensitive, but
string literals are not, so `"Spring"` and `"spring"` are different values and
have to match the casing of the stored data. And evaluation targets under
20ms per interaction, with undefined variables resolving to false by design,
so a reference to something that was never set simply will not match rather
than erroring. The [CQL introduction](https://docs.croct.com/reference/cql/introduction)
covers both behaviours if you want the details.
