# How do I say "on checkout but has not purchased yet" in one CQL condition?

Asked by Bruno Carvalho on 2026-08-04. Tags: cql, audiences, operators.

I want a nudge that only shows to people who are currently on the checkout
page and have not already completed a purchase in this session.

I can express each half on its own, but I am stuck on how to negate one clause
while still requiring the other in the same expression. Do I need two separate
audiences or can it live in one condition

## 3 answers

### Answer from rowan_dev (2026-08-06)

One condition. `not` negates a clause and combines with `and` and `or` like
you would expect:

```cql
page is "checkout" and not user has made purchase
```

The `not` binds to the single clause after it, so the `and` still requires
the page check. No need for a second audience.

#### Reply from Bruno Carvalho (2026-08-07)

That is exactly the shape I was missing, thanks. Reads almost like the
sentence I said out loud.

### Answer from marta_k (2026-08-06)

Works, but one thing to check before you trust it: the purchase signal has
to actually be tracked for the negation to mean anything. Undefined variables
evaluate to false, which is normally handy, but it cuts the other way here.
If `user has made purchase` is never populated it is always false, so `not`
of it is always true and everyone on checkout matches.

So make sure the event that feeds that condition is firing. If you are
matching on a completed goal instead, the
[retargeting on a completed goal](/answers/cql-completed-goal-retargeting)
thread has the exact form.

### Answer from Devin Ortiz (2026-08-07)

You can lean on the technical style for the parts that suit it and keep the
behavioral clause in words, CQL lets you mix them:

```cql
page.path is "/checkout" and not user has made purchase
```

The keywords are identical either way, so the negation stays readable however
you write the surrounding clauses. I keep the natural form for anything a
marketer will touch.
