Custom analytical fields and their values

Lists custom analytical fields and their possible values via get_analytical_fields. Enables using the analytical dimensions specific to each client.

โ†“ Download skill (.md)
87/100ยท๐Ÿ” Ad hocยทExpertControllerFinance Analyst
SettingsSpend analysisget_analytical_fieldsget_analytical_field_values

๐ŸŽฏ Skill purpose

Lists custom analytical fields and their possible values via get_analytical_fields. Enables using the analytical dimensions specific to each client.

๐Ÿ“Š What it produces

Custom analytical fields with their label, possible values, and filter usage keys.

โšก Benefit

Before

Unknown analytical fields โ€” impossible to use without internal documentation or admin access.

After

Complete client analytical dimensions reference, ready to use in queries.



# Custom analytical fields and their values

## Context

Analytical fields are custom dimensions defined by each company (e.g. project, BU, event code) โ€” distinct from Spendesk's native cost centers. They let you tag payables with custom values.

These values are used as a filter in `spendesk_analyze_spend(analyticalCodes=[id])`.

## 2-step workflow

### Step 1 โ€” List the analytical fields

```json
{
  "tool": "get_analytical_fields",
  "params": {
    "companyId": "<companyId>"
  }
}
```

For each field, note:
- `id`: identifier to pass to `get_analytical_field_values(fieldId)`
- `name`: field label (e.g. "Analytic codes", "Projects", "Clients")
- `type`: `"list"` (enumerated values) or `"boolean"` (checkbox)
- `isArchived`: if true, the field has been decommissioned
- `isSplittable`: if true, a payable can have multiple values for this field
- `availableForEntities`: payable types concerned (`["expense","request","payment","subscription"]`)

### Step 2 โ€” Get the values of a field

```json
{
  "tool": "get_analytical_field_values",
  "params": {
    "companyId": "<companyId>",
    "fieldId": "<field id>"
  }
}
```

Returns the list of valid values: `{ id, value, isArchived }`.

## Pitfall: includeArchived defaults to false, but still returns archived fields

On this account, `get_analytical_fields()` with no parameter returns **21 fields, 16 of which have `isArchived: true`**, despite `includeArchived` defaulting to false. The documented behavior ("archived fields are excluded by default") does not match the actual implementation.

โ†’ Always filter client-side on `isArchived: false` to get only the active fields.

On this account: 5 active fields out of 21:

| ID | Name | Type | Splittable |
|----|-----|------|-----------|
| `S1zHTdxe-` | Analytic codes | list | โœ… yes |
| `kdpholncfz8sdw` | Analytic codes 2021 | list | no |
| `ol-yyb9yal5frj` | B. Start Date (invoice) | list | no |
| `k9__lhhu9gki64` | C. End Date (invoice) | list | no |
| `e3ty_iz-69hgq9` | D. Schedule | list | no |

## Critical discovery: analytical values = expense categories

The IDs of the values returned by `get_analytical_field_values(fieldId="S1zHTdxe-")` are **identical** to the IDs returned by `get_expense_categories`.

Example:
- `get_expense_categories` โ†’ "ABM": `id = r96xprmx87jiso`
- `get_analytical_field_values("S1zHTdxe-")` โ†’ "ABM": `id = r96xprmx87jiso` (same)

โ†’ The "Analytic codes" field and `get_expense_categories` expose **the same reference data**. The IDs from `get_expense_categories` can be used directly in `spendesk_analyze_spend(analyticalCodes=[...])` without going through `get_analytical_field_values`.

## Use in spendesk_analyze_spend

```json
{
  "tool": "spendesk_analyze_spend",
  "params": {
    "companyId": "<companyId>",
    "dateRange": { "startDate": "2026-01-01", "endDate": "2026-06-30" },
    "groupBy": ["analyticalCode"],
    "analyticalCodes": ["r96xprmx87jiso", "lq0vse74ak0q_n"]
  }
}
```

The IDs to pass = the value IDs returned by `get_analytical_field_values`.

## `boolean` fields โ€” no values to fetch

Fields of `type: "boolean"` (e.g. "Approved", "Hardware") have no listable values. They cannot be used as a filter in `spendesk_analyze_spend`. `get_analytical_field_values` would return an empty array for these fields.

## Example user prompts

- "What analytical codes are available to filter spend?"
- "Give me all the values for the 'Analytic codes' analytical field"
- "Analyze spend by analytical code for H1 2026"

How to install this skill

/
  1. 1
    Download the file s37-analytical-fields-values.md using the button above.
  2. 2
    Place the file in the .claude/ directory of your project (or ~/.claude/ for a global install).
    cp s37-analytical-fields-values.md .claude/s37-analytical-fields-values.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 get_analytical_fields, get_analytical_field_values.

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