Recipes 20 pages, all live in your browser
Analysis recipes
Each recipe takes one question an analyst gets every week, builds the answer step by step in Tableau and in SQL, and runs it on the real xmetric engine in your browser. Drop your own CSV on any page and the same steps run on it. Nothing is uploaded.
Customers, retention and conversion
Who comes back, who leaves, and what they buy together.
- RecipeHow do I build a conversion funnel from an event log?Build a funnel from raw events: count users who did each step in order, within a time window, with step-to-step rates. Tableau and SQL, on your CSV.
- RecipeHow do I build a monthly cohort retention table?Group customers by their first purchase month, then track how many come back. Monthly cohort retention with a Tableau FIXED LOD and DuckDB SQL, on your CSV.
- RecipeHow do I calculate monthly customer churn and MRR churn?Monthly customer (logo) churn and MRR churn from a subscriptions CSV, with Tableau FIXED and DuckDB SQL, and why the two can move in opposite directions.
- RecipeHow many of this month's customers are new, and how many came back?Split each month's customers and revenue into new and returning with a FIXED first-order date in Tableau or a window MIN in SQL. Run it on your orders CSV.
- RecipeWhich customers are my best, and which am I about to lose?Score customers on recency, frequency and spend, then name segments. Tableau FIXED and PERCENTILE formulas and SQL, step by step, on your orders CSV.
- RecipeWhich products are really bought together?Find which products sell together. Build confidence and lift step by step in Tableau and SQL, see why the most common add-on misleads, then run it on your CSV.
Dates, trends and period comparisons
Running totals, rolling windows, seasons, streaks and fair year-over-year comparisons.
- RecipeHow do I calculate a 7-day or 28-day moving average?Smooth daily numbers with a trailing 7-day or 28-day average: Tableau WINDOW_AVG and the SQL window frame, step by step. See why a 30-day window jitters.
- RecipeHow do I measure seasonality when the business is growing?Build a seasonality index for each calendar month, then remove growth with a centered 12-month average. Tableau and SQL, step by step, live on your CSV.
- RecipeHow do I make a running total that restarts every year?Build a running total that never resets, then one that restarts every year. RUNNING_SUM in Tableau, SUM OVER in SQL, live on your own CSV.
- RecipeHow do I count consecutive-day streaks and the gaps between them?Find each user's longest and current streak of consecutive days, and the gaps between them, with Tableau LOOKUP and PREVIOUS_VALUE or SQL, on your CSV.
- RecipeHow do I compare this year to date with last year, fairly?Compare year to date against the same days last year, anchored on the last date in your data. Tableau formulas and DuckDB SQL, step by step, on your CSV.
- RecipeAre my stores really growing, or did I just open more of them?Year-over-year growth for stores open in both years only, next to total growth, so openings and closures can't hide a decline. Tableau, SQL, your CSV.
Totals, distributions and ranking
Shares of a total, the long tail, medians, ranks and counts that don't double-count.
- RecipeHow do I compare budget to actual when the budget repeats on every row?Compare monthly budgets to actual spend without counting the budget once per invoice. Variance and attainment with Tableau INCLUDE and SQL, on your CSV.
- RecipeWhich few products make most of your revenue?Find the products that make 80% of revenue. Build the Pareto curve step by step with Tableau formulas and SQL, then run it on your own CSV.
- RecipeHow do I get the median and P90 for each group?Compute medians and P75, P90, P95 per group with Tableau MEDIAN and PERCENTILE and DuckDB QUANTILE_CONT. See how the mean ranks groups backwards.
- RecipeWhy does my percent of total change when I filter?Keep a percent-of-total denominator stable when you filter: TOTAL() vs { FIXED } in Tableau, window totals before WHERE in SQL. Live on your CSV.
- RecipeTwo values tie. Which rank function should I use?How RANK, RANK_DENSE, RANK_MODIFIED and RANK_UNIQUE treat ties in Tableau, with the SQL window functions for each. See who makes a top-N cut, on your CSV.
- RecipeHow do I show the top N in each category, with the rest as Other?Rank items inside each category and group everything past the top N as Other, with RANK_UNIQUE in Tableau and ROW_NUMBER in SQL, live on your CSV.
- RecipeHow do I calculate a weighted average by group?Average a price or rate weighted by volume, per group, and see how far plain AVG drifts. Tableau formulas and SQL, step by step, live on your CSV.
- RecipeWhy don't my distinct counts add up to the total?Distinct counts per group never sum to the grand total. See why, measure the overlap, and pick the right total, with Tableau and SQL on your own CSV.