How to Pivot Data in SQL: PIVOT vs CASE WHEN
Turn rows into columns in SQL with CASE WHEN or PIVOT. Copy-paste examples for PostgreSQL, SQL Server, Snowflake and DuckDB, plus how to unpivot.
Notes & writing
Revenue Operations, payments and data analytics — practical notes from running RevOps and analytics at scale.
Turn rows into columns in SQL with CASE WHEN or PIVOT. Copy-paste examples for PostgreSQL, SQL Server, Snowflake and DuckDB, plus how to unpivot.
ROAS vs ROI vs MER explained with one worked example. Learn what each measures, how to find your break-even ROAS, and when to trust each one.
How I use spec-driven development with Claude Code to build a real site: the six docs, the rules that keep chat out of them, and a real session.
Why most AI transformation programmes stall, what the research says, and a practical data-readiness checklist analysts can run first.
What first-principles thinking means for a data analyst, with worked examples: questioning a metric, a benchmark and a dashboard request.
The recurring SQL interview patterns behind most data analyst interviews, how to approach each, and how interviewers actually grade the answers.
How the RICE scoring framework works, a worked example ranking three features, and where it breaks down as a decision tool.
What each UTM parameter does, the case-consistency trap that splits your reports, and a simple naming convention that keeps tracking usable.
How to calculate CAC payback period from gross margin, why it differs from LTV:CAC, and what counts as healthy at different SaaS stages.
Revenue multiples vs discounted cash flow for early-stage SaaS valuation. What each method assumes, when each breaks down, and how they relate.
Calculate break-even units, margin of safety, and the extra volume a discount actually requires to stay profit-neutral, with worked examples.
MRR, churn, NRR, quick ratio and Rule of 40 explained in plain English, with a worked example showing why revenue growth alone can hide trouble.
Most dashboards get built, launched and forgotten. Design for decisions, keep the metric count low, define every number, keep data fresh and review usage.
The mistakes that quietly invalidate an A/B test even when the math is done correctly — peeking early, underpowered samples, and more.
How an analyst can set up Claude Code to work with CSV files, SQL and Python safely. Project folder, context file, permissions, Git and a first session.
What the chi-square test measures, how to read observed vs expected counts, and when it's more useful than a simple two-proportion test.
How to calculate the sample size an A/B test needs and how to read the result once it's done, with a worked example and a free calculator.
What separates an AI agent from a chatbot for analyst work, a minimal worked example, and the guardrails to put around it before it touches real data.
General chat assistants vs BI copilots vs dedicated text-to-SQL products. What each does well, where each breaks, and how to evaluate one.
LLMs predict plausible text, not computed results. See why they invent numbers in analytics work, the patterns to watch for, and how to catch it before it reaches a report.
What hiring managers look for in a data analyst portfolio, how to choose three strong projects, and how to present each one around a business problem.
Power BI vs Tableau compared on cost, modeling, visual flexibility and learning curve, with a practical way to decide between them.
VAR...RETURN makes DAX measures faster, easier to debug and easier to read. See the syntax, the performance reason, and the one gotcha with context transition.
Set up Power BI row-level security step by step, static and dynamic, plus the pitfalls that let data leak past a security role.
A semantic layer defines your metrics once so people, dashboards and AI all use the same numbers. Learn what it is, what it changes for text-to-SQL, and how to start small.
Learn to read EXPLAIN output, spot the difference between a scan and an index, and fix the handful of causes behind most slow SQL queries.
Which tool for which job? A practical way to choose between Excel, SQL and Power BI, based on data size, repeatability, audience and who needs to reuse the work.
A practical checklist for checking AI-generated analysis: reconcile totals, trace every number, test edge cases and label what is still an assumption.
WHERE filters rows, GROUP BY collapses them into groups, HAVING filters the groups. See SQL's real execution order and where each clause belongs.
What INNER, LEFT, RIGHT and FULL joins actually do, why rows duplicate or disappear, and how to pick the right one for a report.
How to present analysis so busy, non-technical people act on it. A simple structure, slide habits, and the mistakes that make good analysis get ignored.
Stop dashboard debates with a one-page metric definition. Includes a copy-paste template, a filled-in example and the owner, grain and exclusion rules that matter.
A practical split of analyst work into tasks AI does well, tasks it can help with under supervision, and tasks that should stay yours, with examples.
A slow Power BI report usually has a few clear causes. Measure with Performance Analyzer first, then apply these seven fixes, biggest payoff first.
How to get reliable SQL from ChatGPT, Claude or Copilot. What context to give, how to use examples, and the checks that catch wrong joins and made-up columns.
Build year-to-date, year-over-year and rolling 12-month measures in DAX. Includes the date table rules that make time intelligence work, with copy-paste measures.
CALCULATE is the most important DAX function and the most confusing. Learn filter context, row context and context transition with simple examples.
Not sure whether to clean data in Power Query or calculate in DAX? Use this simple rule, with examples for calculated columns, measures and the M language.
What a star schema is, why Microsoft recommends it for Power BI, and how to reshape a flat table into facts and dimensions step by step.
CTE, subquery or temp table? A plain-English comparison for analysts, with examples, the performance trade-offs, and a simple rule for choosing.
Handle dates in SQL without wrong totals. DATE_TRUNC, week starts, fiscal years and time zones explained for analysts, with queries and a calendar table.
Find duplicate rows in SQL with GROUP BY and ROW_NUMBER, then remove them safely. Copy-paste queries, the traps to avoid, and how to stop duplicates coming back.
Build a cohort retention table in SQL in three steps. Includes a full PostgreSQL query, how to read the triangle, and the mistakes that skew retention.
A practical SQL cheat sheet for data analysts. Fifteen copy-paste queries for filtering, joins, aggregates, CTEs, windows and dates, with plain-English notes.
A practical guide to Power BI design: star schema, calculation groups, field parameters and dashboard layout habits that keep reports fast and easy to maintain.
What Copilot in Power BI does well, where it breaks, and how to test it on your own semantic model before business users start trusting its answers.
Learn how to measure sales forecast accuracy with WAPE and bias, why a perfect team total can hide rep-level errors, and how to spot sandbagging in your data.
Query CSV, Parquet and Excel files with plain SQL on your own machine using DuckDB. Practical examples, plus honest limits on concurrency and shared use.
Save Power BI as text, version it in GitHub and connect an LLM to write DAX and M. Why this workflow changes how analysts build, review and trust their models.
AI can write valid SQL in seconds, but it can't know which definition of revenue your CFO approved. Why a governed metrics layer matters, with benchmark data.
Window functions keep your rows while you calculate across them. Learn ten patterns: ranking, deduplication, running totals, LAG, cohorts and streaks.
RevOps benchmark reports are everywhere, but few show their sources. See what Gartner reports, how to vet a benchmark, and which metrics to track yourself.
Learn to forecast e-commerce revenue from customer cohorts. Includes SQL, a worked backtest, and the common mistake that cost 9% forecast accuracy.
Bad CRM data quietly breaks forecasts and reports. Use this 10-point revenue data audit with ready-to-run SQL checks to find and fix the biggest gaps.
Do network tokens raise card approval rates? Compare Visa's 4.8% and Mastercard-cited 10.3-point figures, and learn why the numbers differ.
False declines turn good customers away. See what the data says about their cost, why they happen, and how to measure and reduce them in e-commerce.
Attribution, incrementality tests and marketing mix modeling answer different questions. Learn when to use each, with evidence from field experiments.
What do Visa, Mastercard and Amex decline codes mean? A plain-English guide to the most common codes and what merchants should do next.