# `SequenceEnrollmentOverlap`
[🔗](https://github.com/jaizendra-netizen/sequence_enrollment_overlap/blob/main/lib/sequence_enrollment_overlap.ex#L1)

Show which contacts sit in more than one outreach sequence.

Input is a CSV with the columns `contact` (an email or any id; trimmed and lowercased)
and `sequence` (a label; trimmed, compared case-insensitively, the first spelling seen is
shown). Extra columns are ignored. The same contact and sequence pair on two rows counts
once; the extra rows are reported as duplicate rows collapsed.

The tool reads the file you give it. It sends nothing and has no network access.

# `row`

```elixir
@type row() :: %{
  line: pos_integer(),
  contact: String.t(),
  key: String.t(),
  label: String.t()
}
```

# `analyze`

```elixir
@spec analyze([row()]) :: map()
```

Analyse parsed rows. Returns a map with `:rows`, `:contacts`, `:enrollments`,
`:duplicates`, `:multi` (all contacts in more than one sequence, sorted by number of
sequences descending then contact, each `{contact, [labels]}`), `:sequences` and `:pairs`.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, [row()]} | {:error, String.t()}
```

Parse CSV text into rows. Returns `{:ok, rows}` or `{:error, message}`.

# `pct`

```elixir
@spec pct(number(), number()) :: String.t()
```

Format a percentage with one decimal.

# `render`

```elixir
@spec render(map()) :: String.t()
```

Render the analysis as text.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
