Skip to main content
Learning PathLesson 4 of 4 · Foundation
Foundation · Lesson 4 of 4beginner8 min read

The Iteration Loop — Ask, Refine, Validate

You don't need to get it right the first time. Learn the describe-build-review-refine cycle that makes AI a reliable analytics partner.

Here's a secret that experienced AI users know: nobody gets a perfect result on the first try. The power isn't in the first response — it's in the conversation. AI works best as an iterative partner, not a one-shot oracle.

The Four-Step Loop

Every interaction with AI follows this cycle. Get comfortable with it, and you'll never feel frustrated with AI responses again:

  1. Describe — Tell the AI what you need (use the Context + Task + Format pattern from the previous lesson)
  2. Review — Look at what you got. Is it close? Completely off? Partially right?
  3. Refine — Give specific feedback. "Change X to Y" is better than "this isn't right"
  4. Validate — Check the output against what you know. Does the data make sense? Do the numbers add up?

See It In Action

Here's a real iteration building a campaign performance query:

Prompt Example
any

Iteration 1 — First attempt:

Write a SQL query showing campaign performance by channel for last month.
AI Generatedany
SELECT channel, SUM(spend) as total_spend, SUM(conversions) as total_conversions FROM campaigns WHERE date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1 month') GROUP BY channel ORDER BY total_spend DESC;
Prompt Example
any

Iteration 2 — Refine with specifics:

Good start, but I also need:
- Revenue and ROAS (revenue / spend)
- CPA (spend / conversions)
- Month-over-month comparison with the previous month
- Only channels with spend > $100
- Format ROAS as a decimal with 2 places
Prompt Example
any

Iteration 3 — Validate and polish:

The query looks right but I noticed it doesn't handle the case where conversions = 0 (division by zero for CPA). Also, can you add a column that flags channels where ROAS dropped more than 20% month-over-month? Label it 'needs_attention'.
Pro Tip
The magic number is 3. Most tasks converge on a great result within 3 iterations. If you're past 5 iterations and still not happy, start a fresh conversation with a better initial prompt — don't keep patching.

Refinement Phrases That Work

When you review an AI response, use specific feedback instead of vague complaints:

Manual Workflow

"This isn't what I wanted" "Try again" "Make it better" "That's wrong"

With AI

"Change the date range from 30 days to last calendar month" "Add a ROAS column calculated as revenue / spend" "The CPA formula should handle zero conversions — use NULLIF" "Remove the impressions column, I don't need it"

When to Start Over vs. Keep Iterating

Keep iterating when the AI understood your intent but the details need work. Start over when it completely misunderstood what you're trying to do — no amount of refinement will fix a wrong foundation.

Watch Out
Always validate AI-generated numbers against a source you trust. If AI says your Google Ads ROAS is 5.2x, spot-check it against your actual Google Ads dashboard. The iteration loop isn't complete until you've verified the output.
Try It Yourself

Practice the iteration loop. Start with a deliberately vague prompt, then iterate 3 times to get a useful result:

Start with this vague prompt:
"Analyze my marketing performance"

Then iterate:
1. Add context (your role, data structure, database type)
2. Add specifics (which metrics, time period, grouping)
3. Add format requirements (output format, sorting, thresholds)

Notice how each iteration gets you dramatically closer to what you actually need.

You've now completed the Foundation track. You understand what AI can do, which tools to use, how to prompt effectively, and the iteration workflow. Next up: Core Skills — where you'll apply these foundations to real analytics tasks.

Get weekly job alerts

Curated marketing analytics roles — delivered every Monday.