PipelineStageDuration (pipeline_stage_duration v1.0.0)

Copy Markdown View Source

Days spent in each pipeline stage, from a stage-history CSV with the columns deal,stage,entered,exited (dates as YYYY-MM-DD; leave exited empty for a deal still in the stage). Open rows are measured up to the as_of date you pass.

Summary

Functions

Parse the CSV text into stage rows {stage, days}.

Printable table.

Average, median and longest days per stage, longest average first.

Types

stat()

@type stat() :: %{
  stage: String.t(),
  deals: non_neg_integer(),
  avg: float(),
  median: float(),
  longest: non_neg_integer()
}

Functions

parse(text, as_of)

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

Parse the CSV text into stage rows {stage, days}.

render(stats)

@spec render([stat()]) :: String.t()

Printable table.

stats(rows)

@spec stats([{String.t(), non_neg_integer()}]) :: [stat()]

Average, median and longest days per stage, longest average first.