Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.keystn.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

While the built-in analytics modules cover common use cases, every mortgage operation has unique questions. Custom Metrics gives you a flexible query builder that lets you define, save, and evaluate metrics tailored to your specific needs.

Creating a Custom Metric

To create a metric, navigate to Analytics > Custom and click the button to add a new metric.

Metric Definition Fields

FieldDescription
NameA short, descriptive name for the metric (up to 100 characters). Example: “Avg Loan Size - Purchase”
DescriptionOptional longer description (up to 500 characters) explaining what the metric measures and why it matters.
Pin to DashboardWhen enabled, the metric appears at the top of the custom metrics page for quick access.

Configuration

The metric configuration controls what data is queried and how it is processed.

Aggregation

Choose how to compute the result:
AggregationDescription
CountNumber of matching loans
SumTotal of the selected field across all matching loans
AverageMean value of the selected field
MinMinimum value of the selected field
MaxMaximum value of the selected field

Field

Select which loan field to aggregate:
FieldDescription
Loan AmountThe principal loan amount
Broker CompensationBroker compensation / revenue
Net Loan RevenueNet loan revenue after adjustments
Gross Loan RevenueGross loan revenue
Company MarginCompany margin on the loan
Origination FeesOrigination fees charged
RateInterest rate
Note: When using the Count aggregation, the field selection is less important since Count simply counts matching records.

Date Field

Choose which date field is used for date range filtering:
Date FieldDescription
Funded DateThe date the loan was funded (default)
Closed DateThe date the loan closed
App Intake DateThe date the application was received
Created DateThe date the loan record was created

Filters

Add one or more filters to narrow which loans are included in the calculation. Each filter specifies a field, an operator, and a value. Available operators:
OperatorMeaning
EqualsExact match
Not EqualsExcludes matching values
Is One OfMatches any value in a list
Greater ThanNumeric comparison
Greater Than or EqualNumeric comparison
Less ThanNumeric comparison
Less Than or EqualNumeric comparison
Example filters:
  • Loan Purpose = Purchase — Only purchase loans
  • Loan Type is one of FHA, VA — Only FHA and VA loans
  • Loan Amount >= 500000 — Only loans above $500K

Group By

Optionally group results to see the metric broken down by a dimension:
Group ByDescription
Loan OfficerGroup by loan officer
LenderGroup by lender
Lead SourceGroup by lead source
Loan PurposeGroup by Purchase / Refinance
Loan TypeGroup by loan product type
ChannelGroup by Broker / Non-Delegated Correspondent
MonthGroup by calendar month
QuarterGroup by calendar quarter
YearGroup by year
When a group-by is set, the metric returns both an overall value and a breakdown by group, sorted by value descending.

Visualization

Choose how the metric is displayed:
VisualizationBest For
CardSingle-value KPIs (total volume, average loan size)
BarGrouped comparisons (volume by lender, units by LO)
LineTime-series trends (monthly volume, quarterly revenue)
PieProportional breakdowns (loan type mix, purpose split)
AreaTime-series with emphasis on cumulative volume

Comparison Period

Optionally enable a comparison to a prior time range:
ComparisonDescription
Prior PeriodCompare against the immediately preceding period of equal duration. If you select Jan-Mar, the comparison is Oct-Dec.
Year over YearCompare against the same date range in the previous year. If you select Q1 2026, the comparison is Q1 2025.
When enabled, the metric result includes both the comparison value and the percentage change.

Evaluating a Metric

Once created, a metric can be evaluated for any date range. The evaluation engine applies the metric’s filters, date range, and aggregation to matching loans. If a group-by is configured, results are broken down by that dimension. If a comparison period is enabled, prior-period values are calculated alongside the current period.

Result Structure

Each evaluation produces:
Result FieldDescription
ValueThe primary computed value (e.g., total volume = $15,000,000)
GroupedIf group-by is set, an array of { label, value } pairs sorted by value descending
ComparisonIf comparison is enabled, the prior period value and the percentage change

Managing Custom Metrics

Pinning

Pin important metrics to keep them at the top of the dashboard. Pinned metrics appear first, followed by unpinned metrics sorted by display order and creation date.

Editing

Click on a metric to modify its name, description, configuration, or pinned status. Changes take effect immediately for all future evaluations.

Deleting

Deleting a metric hides it from the dashboard but retains the record.

Example Metrics

NameAggregationFieldFiltersGroup ByViz
Total Funded VolumeSumLoan Amount(none)(none)Card
Avg Purchase Loan SizeAverageLoan AmountLoan Purpose = Purchase(none)Card
Volume by Loan OfficerSumLoan Amount(none)Loan OfficerBar
Monthly Revenue TrendSumBroker Compensation(none)MonthLine
Loan Type MixCountLoan Amount(none)Loan TypePie
FHA Volume by QuarterSumLoan AmountLoan Type = FHAQuarterArea
Revenue by Lead SourceSumBroker Compensation(none)Lead SourceBar
Avg Rate by LenderAverageRate(none)LenderBar