Spending by cost center and employee

Analyzes spending by cost center with per-employee detail. Automatically resolves cost center names from their IDs for a readable report.

↓ Download skill (.md)
85/100Β·πŸ“† MonthlyΒ·IntermediateFinance AnalystController
Spend analysisReportsspendesk_analyze_spendget_cost_centers

🎯 Skill purpose

Analyzes spending by cost center with per-employee detail. Automatically resolves cost center names from their IDs for a readable report.

πŸ“Š What it produces

Cross-table cost center Γ— employee with amounts, transaction counts, and resolved names.

⚑ Benefit

Before

Manual export then pivot table in Excel to cross cost centers and employees.

After

Instant cost center Γ— employee breakdown with plain text names, no Excel needed.



# Instructions β€” Spend by cost center and employee

## ⚠️ Cost center names vs employee names: different behavior

In `spendesk_analyze_spend`:

| Dimension | `key` returned | `id` returned |
|-----------|---------------|--------------|
| `costCenter` | Cost center **name** (e.g. "Marketing") | Cost center UUID |
| `supplier` | Supplier **ID** | ID (identical) |
| `employee` | **Name** if available (e.g. "Sabine Juin") | Employee ID |
| | **ID** if archived or nameless (e.g. "d2uvqq5sbi6oth") | ID (identical) |

β†’ **Name resolution is only needed for `employee` when `key === id`** (archived/nameless user).

## ⚠️ "X -old-" cost centers: not archived in the system

`get_cost_centers` returns cost centers whose name starts with "X -old-" or "X- old" but with `isArchived=false`. These "deprecated by convention" cost centers remain active in the system and can appear in historical data.

β†’ Always use `get_cost_centers` to get the list of active IDs if the user wants to filter on a subset of departments.

## Step 1 β€” Retrieve active cost centers (if filtering is needed)

```json
{ "companyId": "...", "includeArchived": false }
```

β†’ Returns id + name + isArchived for all cost centers.
β†’ Use the IDs in `filters.costCenterIds` to target a department.

## Step 2 β€” Analysis with double breakdown

```json
{
  "companyId": "...",
  "fromDate": "YYYY-MM-DD",
  "toDate": "YYYY-MM-DD",
  "groupBy": ["costCenter", "employee"],
  "limit": 10
}
```

β†’ Returns: top-10 cost centers (by amount), each cost center with its top-10 employees.
β†’ An "Others" row appears if there are > 10 cost centers or > 10 employees per cost center.

## Step 3 β€” Filtering on a single cost center

To see ALL employees of a department (not just the top-10):
```json
{
  "companyId": "...",
  "fromDate": "YYYY-MM-DD",
  "toDate": "YYYY-MM-DD",
  "groupBy": ["costCenter", "employee"],
  "filters": { "costCenterIds": ["<cost-center-uuid>"] },
  "limit": 50
}
```

β†’ With a single cost center filtered, `limit=50` at the employee level gives the 50 biggest spenders.

## Step 4 β€” Interpreting the fields

Each cost center row:
- `key`: cost center **name**
- `id`: cost center UUID
- `amount` / `count` / `share`: cost center aggregates
- `breakdown[]`: top-N employees in this cost center

Each employee row (in breakdown):
- `key`: **name** if available, **ID** if archived or nameless
- `id`: employee ID (always)
- `amount` / `count` / `share`: the employee's spend within THIS cost center

## Step 5 β€” Handling nameless employees

```
breakdown.forEach(emp => {
  const displayName = (emp.key !== emp.id)
    ? emp.key                // resolved name
    : `[Archived user: ${emp.id.substring(0,8)}...]`  // ID fallback
})
```

## Live example (H1 2026, groupBy=["costCenter","employee"])

**Total: EUR 8,174,523.65 β€” 3,937 payables**

| Rank | Cost Center | Amount | Share | Top spender |
|------|-------------|---------|-------|--------------|
| 1 | **People** | EUR 2,078,260.64 | 25.4% | `d2uvqq5sbi6oth` (ID only) β€” EUR 691,423.46 (33.3%) |
| 2 | **Marketing** | EUR 1,867,209.46 | 22.8% | Loretta Nguyen β€” EUR 1,141,489.15 (61.1%) |
| 3 | **Engineering Foundations** | EUR 1,563,799.22 | 19.1% | Hoang-Huy Jean-Pierre Huynh β€” EUR 529,153.49 (33.8%) |
| 4 | **Product Engineering** | EUR 592,502.11 | 7.2% | Guilhem Bellion β€” EUR 142,850.34 (24.1%) |
| 5 | **Revenue Operations** | EUR 591,595.97 | 7.2% | SΓ©bastien van Hoof β€” EUR 471,241.01 (79.7%) |
| 6 | **Strat Ops** | EUR 253,422.42 | 3.1% | Vincent Mothes β€” EUR 104,412.26 (41.2%) |
| 7 | **Revenue** | EUR 200,824.70 | 2.5% | Maria Eugenia Montes Pita β€” EUR 166,139.29 (82.7%) |
| 8 | **Security Engineering** | EUR 178,840.45 | 2.2% | Jonathan Fedida β€” EUR 118,558.80 (66.3%) |
| 9 | **Product** | EUR 164,276.49 | 2.0% | Julien Chriqui β€” EUR 26,246.65 (16%) |
| 10 | **Finance** | EUR 162,699.94 | 2.0% | Eva Tourki β€” EUR 53,461.60 (32.9%) |
| β€” | Others | EUR 521,092.25 | 6.4% | β€” |

Observations:
- The top spender in "People" is an ID (archived user) β€” EUR 691K with no displayed name
- Marketing is highly concentrated: Loretta Nguyen accounts for 61.1% of the department's spend
- Revenue Operations: SΓ©bastien van Hoof = 79.7% of the cost center (strong dependency on a single employee)
- Revenue Operations "Others" = EUR -13,427.11 (negative) β€” credit notes from employees outside the top-10

## Example prompts

- "Which teams spend the most?" β†’ groupBy=["costCenter"], no employee breakdown
- "Who spends the most in each department?" β†’ groupBy=["costCenter","employee"], limit=5
- "Marketing team spend by employee" β†’ groupBy=["costCenter","employee"], costCenterIds=[marketing_id]
- "Which department concentrates its spend on few employees?" β†’ read the top-1 share in each breakdown

How to install this skill

/
  1. 1
    Download the file s08-depenses-par-cost-center-employe.md using the button above.
  2. 2
    Place the file in the .claude/ directory of your project (or ~/.claude/ for a global install).
    cp s08-depenses-par-cost-center-employe.md .claude/s08-depenses-par-cost-center-employe.md
  3. 3
    Use in Claude Code β€” the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
πŸ’‘ Make sure the Spendesk MCP is configured in your .claude/settings.json with the tools spendesk_analyze_spend, get_cost_centers.

Similar skills

β˜… Top
95/100Β·πŸ” Ad hocΒ·Expert

MCP coverage audit & gap analysis

Probes all available MCP tools, re-evaluates coverage of 50 persona use cases, detects new fields or tools, and regenerates the gap analysis report.

CFOControllerAP Manager
90/100Β·πŸ“… WeeklyΒ·Beginner

Card requests via get_requests

Explains how to use get_requests for card requests and why expense reimbursements don't appear there. Avoids a frequent source of confusion between two distinct workflows.

ControllerFinance Analyst
90/100Β·πŸ” Ad hocΒ·Intermediate

Active vs archived cost centers

Distinguishes active cost centers from archived ones with correct use of get_cost_centers. Avoids the counter-intuitive isArchived vs isActive naming convention pitfall.

ControllerFinance Analyst