## Is your feature request related to a problem?

Say you have a funnel: Sign Up -> Discover Learning. And you're interested in a specific kind of user: one that, say, didn't invite teammates to the project.

It's hard to represent this using segmentation / breakdowns, since the users you're interested in are defined by what _events_ they didn't trigger.

So, we'd like to support excluding events (and in turn, disqualifying users) who did a certain event.

More example use cases:

1. (1) Search -> (2) Watch Movie. And in this case, I want to exclude extra search events happening inside the funnel. (So, focusing on users who watched a movie after just one search, instead of multiple searches).
2. Looking at behaviour funnel of users who did NOT click the call to action at any point.
3. ???

## Describe the solution you'd like

The first and third examples are qualitatively different from the second example (search->movie).

Let's tackle the former first: In this case, given a funnel date range, I want to exclude all users who did the event within the date range. This implies an exclusion filter over the date range, i.e. exclude all people who did this specific event between `date_from` and `date_to`.

This doesn't work with the latter case, because the funnel step, and the exclusion event are the same: "search". For this case, we introduce the concept of "exclusion within conversion time".

### What is Conversion Window?

Given a funnel `A->B`, and a date range from, say, `-7d` to `now`, the conversion window is the maximum allowable time within which a user should do events A and B. (our code controls this parameter using the `funnel_window_days` parameter).

---

Exclusion within conversion time means that if the user does events `A->A->B` within the conversion window, this user is disqualified from the funnel.

However, if this user did `A->B->A` within 20 minutes (which is within the funnel date range, and within conversion window) - this user is **not** disqualified, because they completed the funnel before the second A event.

This also implies that when dealing with exclusion within conversion time with duplicates, we choose the first event that we see as the start of the conversion window.

Do we count a user where we see two As, but no B? If the second A happened before the conversion window ends, then they're disqualified. Otherwise, no.

## Additional context

### What we're deciding not to do(?)

An alternative way to deal with (search->movie, excluding multiple search) case is to allow exclusion between steps. Such that, say you have a funnel, `X->A->B`, you can have exclusion events within every two steps of the funnel (X->A, A->B).

This introduces complications, both in the UI, and what the exclusions mean. For example: consider `X->A-B` and exclusion of A between A and B: Is the 'first' A the A corresponding to the first X, or the first A corresponding to all `X->A` half-funnels? 

#### Is there a way to work around this using what we have?

Yes! Given an exclusion funnel result, we could create a static cohort out of all the people entering the funnel, and now you can create all sorts of funnels out of this cohort. 

## Alternative solutions

It's worth thinking about other ways of solving this, specially the "excluding event which is also a part of the funnel step" case. I haven't done this yet, opting to preserve the context so far for now.

#### *Thank you* for your feature request – we love each and every one!

ee/clickhouse/queries/funnels/base.py
if self._filter.breakdown_type == "cohort":
                extra_join = self._get_cohort_breakdown_join()
            else:
                breakdown_conditions = self._get_breakdown_conditions()
                extra_conditions = "AND prop != ''" if select_prop else ""
                extra_conditions += f"AND {breakdown_conditions}" if breakdown_conditions and select_prop else ""
        return FUNNEL_INNER_EVENT_STEPS_QUERY.format(
            steps=steps,
            event_query=event_query,
            extra_join=extra_join,
            steps_condition=steps_conditions,
            select_prop=select_prop,
            extra_conditions=extra_conditions,
        )
    def _get_steps_conditions(self, length: int) -> str:
        step_conditions: List[str] = []
        for index in range(length):
            step_conditions.append(f"step_{index} = 1")
        for entity in self._filter.exclusions:
            step_conditions.append(f"exclusion_step_{entity.funnel_from_step} = 1")
        return " OR ".join(step_conditions)
    def _get_step_col(self, entity: Entity, index: int, entity_name: str, step_prefix: str = "") -> List[str]:
        # 
        # 
        step_cols: List[str] = []
        condition = self._build_step_query(entity, index, entity_name, step_prefix)
        step_cols.append(f"if({condition}, 1, 0) as {step_prefix}step_{index}")
        step_cols.append(f"if({step_prefix}step_{index} = 1, timestamp, null) as {step_prefix}latest_{index}")
        return step_cols
    def _build_step_query(self, entity: Entity, index: int, entity_name: str, step_prefix: str) -> str: