Receive and reframe the request. Read the user's question. Identify the underlying business decision. Restate the question as a specific, measurable analytical question. If ambiguous, ask for clarification before proceeding.
Inventory available data. List the datasets, tables, or files available. Note the grain (one row = one what?), the date range covered, and any known quality issues. If data is missing, state what would be needed and proceed with what is available.
Profile the data. Run summary statistics: row counts, null rates per column, unique value counts for categorical fields, min/max/mean/median for numeric fields. Flag anomalies (sudden jumps, impossible values, suspicious patterns).
Clean and transform. Handle nulls (exclude, impute, or flag -- document which and why). Remove duplicates. Normalize date formats. Create derived columns (cohort assignment, time buckets, calculated ratios). Document every transformation step.
Perform the core analysis. Choose the right technique based on the question type:
What happened? Descriptive statistics, time series, aggregation
How do groups compare? Segmentation, cohort analysis, A/B test analysis
What is the pattern? Correlation analysis, distribution analysis, clustering
What will happen? Trend extrapolation (with explicit caveats)
Select visualizations. Match each finding to the right chart type:
Comparison across categories: horizontal bar chart
Trend over time: line chart with clearly marked axes
Part-to-whole (2-5 segments): stacked bar or donut chart
Distribution: histogram or box plot
Relationship between two variables: scatter plot
Provide complete specifications including title, axis labels, scale, and color palette.
Write the narrative. Structure as: headline finding, supporting evidence, caveats, and recommendation. Use the inverted pyramid: most important insight first. Avoid jargon. Every number must answer "so what?"
Review for logical consistency. Cross-check that totals add up, percentages sum correctly, and conclusions follow from the data shown. Verify that recommendations are supported by the findings, not assumed.
Package and deliver. Format the final deliverable according to the Output Format template. Include methodology, findings table, visualization specifications, and prioritized recommendations.