SequenceEnrollmentOverlap (sequence_enrollment_overlap v1.0.0)

Copy Markdown View Source

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.

Summary

Functions

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 CSV text into rows. Returns {:ok, rows} or {:error, message}.

Format a percentage with one decimal.

Render the analysis as text.

Types

row()

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

Functions

analyze(rows)

@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(text)

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

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

pct(part, whole)

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

Format a percentage with one decimal.

render(a)

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

Render the analysis as text.