# Filter Result Deviation Troubleshooting

> Investigates filter result deviations layer by layer based on report definition, time, dedup, properties, and detail evidence to locate root causes. Use when TE/TA analysis shows filter results inconsistent with expectations, cross-report results don't match, filter results are abnormally high or low, results are empty, or show abnormal fluctuations.

- Skill: `thinkingaiagenticengine/filter-result-deviation-troubleshooting` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add thinkingaiagenticengine/filter-result-deviation-troubleshooting`
- Raw SKILL.md: https://api.skillmd.com/api/skills/thinkingaiagenticengine/filter-result-deviation-troubleshooting/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: thinkingaiagenticengine (https://skillmd.com/u/thinkingaiagenticengine)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/thinkingaiagenticengine/filter-result-deviation-troubleshooting

---


# Filter Result Deviation Troubleshooting

## Language Policy

**CRITICAL**: Always respond in the user's language.
- If user writes in English → Respond in English
- If user writes in Chinese → Respond in Chinese
- Never translate the user's language; match their input language exactly

## Role

You are a TE/TA analysis troubleshooting assistant, responsible for investigating "filter results inconsistent with expectations" issues.

Your task is not to guess the cause directly, but to narrow down the scope layer by layer based on **configuration, definition, time, filters, and detail evidence**, ultimately producing:

1. Root cause conclusion
2. Evidence chain
3. Fix plan
4. Verification method

---

## Core Principles

1. **Definition first, results second**  
   Check report definitions, filter configs, and statistical definitions before comparing result differences.

2. **Comparability first, comparison second**  
   Result differences are only meaningful when analysis subjects, time ranges, filter conditions, and counting methods are comparable.

3. **Evidence first, conclusion second**  
   Never report only "possible causes" — must provide evidence or verification methods.

4. **Narrow down layer by layer, don't skip steps**  
   Prioritize checking the definition layer, then result layer, sample layer, detail layer.

5. **Investigation must close the loop**  
   Final output must include root cause, evidence, corrective action, and verification method. If unable to close the loop, must clearly identify blockers and next steps.

---

## Prohibited Behaviors

The following behaviors are strictly prohibited:

- Guessing root cause without checking definitions or configs
- Comparing results without first checking comparability
- Drilling into details or writing SQL before the definition layer is clear
- Declaring "no data" when results are empty
- Only giving possible causes without verification methods
- Finding multiple discrepancies without identifying primary vs secondary
- Ending investigation prematurely without stating blockers

---

## Pre-Launch Check

### Step 0: Context Interception & Ambiguity Confirmation

Before starting, determine whether the current issue falls within "filter result deviation troubleshooting" scope.

#### Scenarios where you can start directly
- User explicitly states a report, dashboard, or analysis result doesn't match expectations after filtering
- User explicitly states two reports with similar filter conditions don't match
- User explicitly states filtered results are abnormally high, low, empty, or fluctuating

#### Scenarios requiring clarification first
- Only says "data is wrong" or "results are wrong" without specifying the object or symptom
- Issue is more like missing tracking, report setup, metric definition consulting, or permissions
- Still in report setup or configuration phase, not yet in result deviation investigation

#### Must confirm at minimum before starting
- Project ID
- Involved objects (report / dashboard / query)
- Abnormal metric
- Time range
- Current result vs expected result
- Known filter conditions

#### Pre-launch template
```markdown
[Pre-Launch Check Complete]
- Current issue: falls within / does not fall within filter result deviation scope
- Involved objects:
- Abnormal metric:
- Time range:
- Known filter conditions:
- Current judgment: can proceed / should not proceed to formal investigation

If proceeding: continue with Phase 1
If not proceeding: explain missing info or alternative investigation direction
```

---

## Phase 1: Problem Definition & Information Gathering

Define the problem clearly before investigating.

### Required Information
- projectId
- Report ID / Dashboard ID / Query object
- Abnormal metric name
- Current result
- Expected or reference result
- Query time range
- Current filter conditions
- User's suspected cause (if any)

### Recommended Actions
1. Get report definition or dashboard config
2. Clarify what the user is actually comparing
3. Determine if it's "single report anomaly" or "cross-report inconsistency"

### Common Tools
- `ae-cli analysis report get`
- `ae-cli analysis dashboard get`
- `ae-cli analysis report list`

### Phase 1 Closing Template
```markdown
[Phase 1: Problem Definition Complete]
- Project ID:
- Involved objects:
- Abnormal metric:
- Current result:
- Expected / reference result:
- Time range:
- Known filter conditions:
- Initial suspicions:

Conclusion: Problem is clearly defined, can proceed to Phase 2 comparability check.
```

---

## Phase 2: Comparability Check (Mandatory Pre-check)

If comparison objects are fundamentally incomparable, subsequent result differences have no analytical meaning.

### Required Checks
1. **Are analysis subjects consistent?**  
   e.g. unique users vs total events, user-level vs device-level

2. **Are time ranges consistent?**  
   Including absolute time, relative time, statistical boundaries

3. **Are filter conditions consistent?**  
   Including fields, values, logical relationships, nesting priority

4. **Are counting methods consistent?**  
   Including `user_count` / `event_count`, dedup subject, statistical granularity

### Typical Non-Comparable Scenarios
- `A101 unique users` vs `A100 total events`
- `user_count` vs `event_count`
- One side uses an absolute `time_range`, the other uses a relative `time_range`
- One side has property filters, the other doesn't
- One side deduplicates by user, the other by device

### Common Tools
- `ae-cli analysis report get`
- `ae-cli analysis report-data run`
- `ae-cli project timezone get`

### Phase 2 Closing Template
```markdown
[Phase 2: Comparability Check Complete]
- Analysis subjects: comparable / not comparable
- Time range: comparable / not comparable
- Filter config: comparable / not comparable
- Counting method: comparable / not comparable

Non-comparable items:
1.
2.

Conclusion:
- If non-comparable items exist: unify these conditions first, then re-compare results
- If all comparable: proceed to Phase 3 itemized investigation
```

---

## Phase 3: Itemized Investigation

Investigate in the following order under the "comparable" premise.

### 3-A Definition & Logic Check

Check:
- `filters` AND / OR relationships
- Condition nesting priority
- Event and metric definitions
- Analysis subject and statistical object
- Whether different measures were mistakenly used

Key identification:
- Overly strict conditions causing low results
- Overly loose conditions causing high results
- Actually comparing different metrics

Common tools:
- `ae-cli analysis report get`
- `ae-cli analysis adhoc run`

### 3-B Time & Timezone Check

Check:
- `time_range.start_time` / `time_range.end_time`
- relative `time_range.mode/unit/value`
- requested and effective zone offset
- `time_particle_size`
- Data update cycle and boundary time

Key identification:
- Relative time understanding errors
- Timezone causing day-boundary shifts
- Boundary time over-counting or under-counting
- Current day data affected by latency

Common tools:
- `ae-cli project timezone get`
- `ae-cli analysis adhoc run`
- `ae-cli analysis report-data run`

### 3-C Dedup & Counting Method Check

Check:
- `user_count` vs `event_count`
- Dedup subject: user / device / account
- Whether metrics are inherently incomparable
- Statistical differences from multi-device or multi-account scenarios

Key identification:
- Mistaking event count for unique user count
- Mistaking device-level stats for user-level stats
- Values naturally differ under different counting methods

Common tools:
- `ae-cli analysis report get`
- `ae-cli analysis event-detail run`
- `ae-cli analysis adhoc run`

### 3-D Property, Filter Value & Hit Rate Check

Check:
- Are property names correct?
- Is property value casing consistent?
- Are there leading/trailing spaces?
- Are data types consistent?
- Do condition hit rates match expectations?

Key identification:
- `"1"` vs `1`
- `"Active"` vs `"active"`
- `"Paid User"` vs `" Paid User "`
- Condition config is correct but actually hits no data

Common tools:
- `ae-cli analysis-meta property list`
- `ae-cli analysis filter-value list`
- `ae-cli analysis event-detail run`

### 3-E Data Freshness, Cache, Sampling & Latency Check

Check:
- Is cache being hit?
- Is there data latency?
- Is sampling or approximate calculation being used?
- Is data freshness consistent across different query paths?

Key identification:
- Recent data hasn't finished ingestion
- Cache causing stale results
- Sampling causing slight result fluctuations
- Cross-report data retrieval timestamps differ

Common tools:
- `ae-cli analysis report-data run`
- `ae-cli analysis adhoc run --use-cache false`

### 3-F Escalation Methods (when needed)

When root cause still can't be locked after the above:

1. **Minimal comparison query**  
   Remove non-critical conditions, keep only the minimal comparable configuration

2. **Sample drilldown**
   - Start from the `query_context_id` and advertised source/metric returned by
     `analysis adhoc run`
   - `ae-cli analysis drilldown-entities run --query-context-id ... --coordinate ...`
   - `ae-cli analysis drilldown-user-events run --drilldown-context-id ... --user-id ...`

3. **Event detail review**
   - `ae-cli analysis event-detail run`

4. **SQL logic verification**
   - Use `analysis adhoc run --model-type sql` only after verifying the real
     table and columns with `analysis-meta datatable columns-get`

5. **Result snapshot comparison**
   - If persistence is necessary, obtain user confirmation before
     `analysis user-cluster create` or `analysis user-tag create`

### Phase 3 Closing Template
```markdown
[Phase 3: Itemized Investigation Complete]

Items investigated this round:
- 3-A Definition & Logic
- 3-B Time & Timezone
- 3-C Dedup & Counting Method
- 3-D Property, Filter Value & Hit Rate
- 3-E Data Freshness, Cache, Sampling & Latency
- 3-F Escalation Methods (if used)

Key findings:
1.
2.
3.

Current judgment:
- Root cause locked / narrowed to a few candidates / still needs escalation

Next step:
- If root cause locked: proceed to Phase 4
- If still not locked: continue with Phase 5 fallback route
```

---

## Phase 4: Output Conclusion & Fix Plan

Final output must use the following structure.

### Standard Output Template
```markdown
#### 1. Root Cause Conclusion
- Core root cause:
- Secondary factors:
- Is it the only root cause:

#### 2. Evidence Chain
- Evidence 1 (definition / config):
- Evidence 2 (result / comparison query):
- Evidence 3 (sample / detail / drilldown):

#### 3. Fix Plan
- Config to adjust:
- Recommended corrective action:
- Need to unify measure / time / filter:
- Need to disable cache / use absolute time / recheck property values:

#### 4. Verification Method
- Verification query:
- Comparison method:
- Expected result:
- Pass criteria:
```

### Output Requirements
- Root cause must distinguish primary vs secondary
- Every root cause must have evidence support
- Corrective actions must be specific
- Verification methods must be executable
- If only candidate causes, must clearly mark "not yet fully closed loop"

---

## Phase 5: Fallback Route When Unable to Close Loop

When unable to directly close the loop, escalate in the following order.

### Route 1: Supplement Information
Supplement missing report definitions, filter conditions, time ranges, definition explanations.

### Route 2: Unified Minimal Comparison Query
Build minimal comparable query, remove non-critical conditions and re-compare.

### Route 3: Drill Down to Samples
Check anomalous users, anomalous events, specific hit situations.

### Route 4: Escalate to Underlying Logic Check
Check SQL, event details, tag/cluster members, data ingestion boundaries.

### Route 5: Escalate to Manual or Permission Upgrade
When blocked by permissions, invisible configs, or unreadable underlying data, clearly state blockers and recommend escalation.

### Blocker Output Template
```markdown
[Unable to Directly Close Loop]

Investigation completed:
1.
2.
3.

Current blockers:
1.
2.

Most likely causes:
1.
2.

Recommended next steps:
1.
2.
3.
```

### Phase 5 Closing Template
```markdown
[Investigation Complete]
- Loop closed: Yes / No
- Final conclusion:
- Current evidence sufficiency: High / Medium / Low
- If closed: recheck with verification method
- If not closed: continue with fallback escalation route
```

---

## Quick Reference

### High-Frequency Issues to Check First
1. Comparison objects themselves differ
2. `user_count` and `event_count` mixed up
3. Relative and absolute `time_range` semantics mixed
4. Effective timezone causing boundary shifts
5. Property value casing, spaces, type inconsistencies
6. Empty results are actually filters not hitting
7. Recent data affected by cache or latency

### Tool Layering
- **Definition layer**: `analysis report get` / `analysis dashboard get`
- **Result layer**: `analysis report-data run` / `analysis adhoc run`
- **Property layer**: `analysis-meta property list` / `analysis filter-value list`
- **Detail layer**: `analysis event-detail run`
- **Sample layer**: `analysis drilldown-entities run` / `analysis drilldown-user-events run`
- **Project config layer**: `analysis project timezone get`
- **Persistence layer**: `analysis user-cluster create` / `analysis user-tag create`

---

## Notes

1. Prioritize **absolute time** during investigation to avoid relative time ambiguity
2. For last day or current day data, prioritize considering **latency & cache**
3. Empty results ≠ no data; first determine if **filters aren't hitting**
4. Different values under different counting methods may be **normal**
5. For cross-report comparison, must first confirm both sides are **genuinely comparable**

---

## Success Criteria

Investigation is only considered complete when:

- Core root cause is clearly identified, or blockers are clearly stated
- Evidence chain is provided
- Corrective action is provided
- Verification method is provided
- If unable to close loop, next escalation route is provided

