PranavNagrecha/AwesomeSalesforceSkills / skills/admin/analytics-kpi-definition
analytics-kpi-definition
VerifiedUse this skill to define, document, and validate KPI metrics for CRM Analytics — covering metric formula design, dimension selection, target-dataset modeling, benchmark setting, and the KPI register that must exist before any dashboard or lens is built. Trigger keywords: KPI definition CRM Analytics, analytics metric design, analytics target attainment, CRM Analytics measures vs dimensions, analytics benchmark. NOT for laying out the dashboard or lens itself — use admin/analytics-dashboard-design. NOT for scoping data sources, audiences, and drill-down paths — use admin/analytics-requirements-gathering.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.0 KB |
| references/examples.md | markdown | 8.6 KB |
| references/gotchas.md | markdown | 9.1 KB |
| references/llm-anti-patterns.md | markdown | 6.4 KB |
| references/well-architected.md | markdown | 4.8 KB |
| scripts/check_analytics_kpi_definition.pyexecutable | script | 3.4 KB |
| templates/analytics-kpi-definition-template.md | markdown | 2.4 KB |
templates/analytics-kpi-definition-template.md
View on GitHub# Analytics KPI Definition — Work Template
Use this template to produce the KPI register before any CRM Analytics lens or dashboard is built.
## Scope
**Skill:** `analytics-kpi-definition`
**Project / Dashboard Name:** (fill in)
**CRM Analytics Dataset(s) Used:** (fill in)
**Reporting Period:** (fill in)
**Stakeholder Requestors:** (fill in)
**Sign-off Required From:** (fill in)
---
## KPI Register
Complete one row per KPI. Get stakeholder sign-off before development.
| KPI Name | Plain-English Definition | Aggregation Formula | Measure Field | Dimension Fields (GROUP BY) | Filter Criteria | Target Model | Benchmark |
|---|---|---|---|---|---|---|---|
| | Include: X; Exclude: Y | SUM / AVG / COUNT / RATIO | Field name + Type: Measure | Field names + Type: Dimension | | Fixed value / Targets dataset / None | |
---
## Targets Dataset Schema (if required)
**Dataset Name:** ______
| Column Name | Type | Description | Example Values |
|---|---|---|---|
| | Dimension | Join key (must match actuals exactly) | |
| | Dimension | | |
| | Measure | Target value | |
**Load Schedule:** (quarterly / monthly / on demand)
**Join Key to Actuals:** (exact field name and format)
**Case Sensitivity Warning:** Confirm join key values match actuals dataset exactly (case-sensitive)
---
## SAQL Formula Sketches
For each KPI, document the SAQL pattern:
**KPI 1: [Name]**
```saql
q = load "[DatasetName]";
q = filter q by [FilterCriteria];
result = foreach q generate [DimensionField], [AggregationFunction]([MeasureField]) as KPIValue;
result = order result by KPIValue desc;
result = limit result 100;
```
**KPI with Target Attainment:**
```saql
q_actual = load "[ActualsDataset]";
q_target = load "[TargetsDataset]";
q_joined = cogroup q_actual by [JoinKey], q_target by [JoinKey];
result = foreach q_joined generate [JoinKey],
sum(q_actual.[MeasureField]) as Actual,
sum(q_target.Target_Value) as Target,
sum(q_actual.[MeasureField]) / sum(q_target.Target_Value) * 100 as Attainment;
```
---
## Review Checklist
- [ ] All KPIs have plain-English definitions with inclusion/exclusion criteria
- [ ] Measure vs Dimension type confirmed for all fields used in formulas
- [ ] Target attainment model designed for all KPIs requiring it
- [ ] Targets dataset schema defined with join key and load schedule
- [ ] SAQL formula sketch validated against dataset field types
- [ ] Stakeholder sign-off recorded
- [ ] No KPI left as "TBD formula"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |