Analysis & SQL
Funnels, cohorts, churn and segment deep-dives with CTEs and window functions, starting from data I've validated.
Welcome to the portfolio of
Data Analyst · turning data into decisions
Data Analyst · Data Analyst
3+ years in BI, SQL and reporting automation, including Amazon. Based in Hyderabad, India, and open to Data Analyst roles.
About me

I'm a Data Analyst with 3+ years across data analysis, business intelligence and reporting automation, including a Business Analyst role at Amazon. I work in SQL (joins, CTEs, window functions), Power BI (DAX, Power Query, data modelling), Python and Advanced Excel.
My favourite work is the whole loop: clean the data until I trust it, find where the numbers move, size what a fix is worth and test it before anyone ships. I also bring hands-on reconciliation and accounting experience, so finance teams and I speak the same language.
What I do
Funnels, cohorts, churn and segment deep-dives with CTEs and window functions, starting from data I've validated.
Power BI (DAX, Power Query, star schema) and Sheets dashboards that leadership actually opens.
ETL pipelines in SQL, Python and Apps Script, plus daily reconciliation across systems, banks and gateways.
A/B tests done properly, forecasting and classification when a model is the right tool for the question.
Selected work
Retail · Power BI
Sales grew 13% but profit fell 25%. Traced it to deep discounts, Fashion returns and over-bought stock, and sized each fix in ₹.
Finance · Reconciliation · SQL
Matched ERP, gateway and bank in SQL, explained a ₹15.41 L gap to the rupee and turned 24k rows into a short, owned exception list.
Finance · Power BI
Revenue grew 10% but profit fell 3%. Traced it to South-region COGS and marketing overspend, and flagged slow-paying distributors.
E-commerce · A/B testing
Cleaned 285k clickstream events, segmented the funnel in SQL, sized each fix in ₹ and tested a one-page checkout.
Credit risk · Classification
Early-warning model for credit teams. Removed 147 duplicate rows before they could inflate scores; five models tuned.
NLP · Customer insight
Scraped and cleaned product reviews, labelled sentiment and compared seven models so negative feedback surfaces automatically.
Energy · Regression
Predicts solar output from weather so operators can plan supply. Eight regressors compared; Gradient Boosting deployed.
Finance · Time series
30-day AAPL forecast comparing ARIMA, SARIMA, Holt-Winters, Prophet and LSTM on 8 years of daily prices.
Coursework
26
Statistics, hypothesis testing, regression, classification, clustering, recommendation systems and forecasting from the ExcelR certification.
SQL showcase
From my funnel project, run on DuckDB. Each one starts from a question a product or finance team would actually ask.
Business question
Turns six stage counts into a step-by-step funnel with conversion and drop-off at every step.
UNPIVOT · LAG · FIRST_VALUE
-- 01 · Overall funnel with step conversion and drop-off
-- Technique: UNPIVOT wide 0/1 stage flags to long format, then LAG() over the stage order.
WITH stage_counts AS (
SELECT
SUM(reached_session) AS s0_session,
SUM(product_view) AS s1_product_view,
SUM(add_to_cart) AS s2_add_to_cart,
SUM(checkout_start) AS s3_checkout_start,
SUM(payment_attempt) AS s4_payment_attempt,
SUM(purchase) AS s5_purchase
FROM session_funnel
),
long AS (
UNPIVOT stage_counts ON COLUMNS(*) INTO NAME stage VALUE sessions
)
SELECT
CAST(substr(stage, 2, 1) AS INT) AS step,
substr(stage, 4) AS stage,
sessions,
LAG(sessions) OVER (ORDER BY stage) AS prev_stage_sessions,
ROUND(100.0 * sessions / LAG(sessions) OVER (ORDER BY stage), 1) AS step_conversion_pct,
ROUND(100.0 * sessions / FIRST_VALUE(sessions) OVER (ORDER BY stage), 2) AS of_all_sessions_pct,
LAG(sessions) OVER (ORDER BY stage) - sessions AS lost_at_step
FROM long
ORDER BY step;Business question
Compares every device and channel to the site average and keeps only its single weakest step.
UNPIVOT · RANK · QUALIFY
-- 03 · For each segment, which step under-performs the site average the most?
-- Technique: compare every segment-step rate to the site-wide rate, then RANK() within the segment
-- and keep the worst step (QUALIFY).
WITH base AS (
SELECT device, channel,
product_view, add_to_cart, checkout_start, payment_attempt, purchase
FROM session_funnel WHERE device <> 'unknown'
),
long AS (
UNPIVOT base ON device, channel INTO NAME dimension VALUE segment
),
seg AS (
SELECT dimension, segment, COUNT(*) AS sessions,
AVG(product_view) AS r1_session_to_view,
SUM(add_to_cart) / NULLIF(SUM(product_view), 0) AS r2_view_to_cart,
SUM(checkout_start) / NULLIF(SUM(add_to_cart), 0) AS r3_cart_to_checkout,
SUM(payment_attempt) / NULLIF(SUM(checkout_start), 0) AS r4_checkout_to_payment,
SUM(purchase) / NULLIF(SUM(payment_attempt), 0) AS r5_payment_success
FROM long GROUP BY ALL
),
site AS (
SELECT AVG(product_view) AS r1_session_to_view,
SUM(add_to_cart) / SUM(product_view) AS r2_view_to_cart,
SUM(checkout_start) / SUM(add_to_cart) AS r3_cart_to_checkout,
SUM(payment_attempt) / SUM(checkout_start) AS r4_checkout_to_payment,
SUM(purchase) / SUM(payment_attempt) AS r5_payment_success
FROM session_funnel
),
seg_long AS (
UNPIVOT seg ON COLUMNS('^r[0-9]') INTO NAME step VALUE seg_rate
),
site_long AS (
UNPIVOT site ON COLUMNS(*) INTO NAME step VALUE site_rate
)
SELECT s.dimension, s.segment, s.sessions,
substr(s.step, 4) AS weakest_step,
ROUND(100 * s.seg_rate, 1) AS segment_rate_pct,
ROUND(100 * t.site_rate, 1) AS site_rate_pct,
ROUND(100 * (s.seg_rate / t.site_rate - 1), 1) AS vs_site_pct
FROM seg_long s JOIN site_long t USING (step)
QUALIFY RANK() OVER (PARTITION BY s.dimension, s.segment ORDER BY s.seg_rate / t.site_rate) = 1
ORDER BY vs_site_pct;Business question
Pivots the first timestamp of each stage per session, then reports median and p90 time by device.
FILTER · QUANTILE_CONT · date_diff
-- 04 · How long do people take between steps? (converted sessions only)
-- Technique: conditional MIN() to pivot first timestamp per stage, then median/p90 with QUANTILE_CONT.
WITH firsts AS (
SELECT session_id,
MIN(event_ts) FILTER (WHERE event_name = 'session_start') AS t0,
MIN(event_ts) FILTER (WHERE event_name = 'add_to_cart') AS t2,
MIN(event_ts) FILTER (WHERE event_name = 'checkout_start') AS t3,
MIN(event_ts) FILTER (WHERE event_name = 'payment_attempt') AS t4,
MIN(event_ts) FILTER (WHERE event_name = 'purchase') AS t5
FROM events
GROUP BY session_id
HAVING t5 IS NOT NULL
),
gaps AS (
SELECT f.session_id, s.device,
date_diff('second', t0, t2) AS land_to_cart_s,
date_diff('second', t2, t3) AS cart_to_checkout_s,
date_diff('second', t3, t4) AS checkout_to_payment_s,
date_diff('second', t0, t5) AS land_to_purchase_s
FROM firsts f JOIN sessions s USING (session_id)
)
SELECT device,
COUNT(*) AS orders,
ROUND(QUANTILE_CONT(land_to_cart_s, 0.5) / 60, 1) AS median_land_to_cart_min,
ROUND(QUANTILE_CONT(cart_to_checkout_s, 0.5) / 60, 1) AS median_cart_to_checkout_min,
ROUND(QUANTILE_CONT(checkout_to_payment_s, 0.5) / 60, 1) AS median_checkout_to_payment_min,
ROUND(QUANTILE_CONT(land_to_purchase_s, 0.5) / 60, 1) AS median_total_min,
ROUND(QUANTILE_CONT(land_to_purchase_s, 0.9) / 60, 1) AS p90_total_min
FROM gaps
GROUP BY device
ORDER BY orders DESC;Business question
Sizes four levers by closing half the gap to a benchmark, then ranks them by extra revenue.
Multi-CTE · UNION ALL · RANK
-- 07 · Revenue opportunity for each hypothesis (quarterly, ₹)
-- Assumption for every lever: we close HALF of the gap to the benchmark (a realistic, not best-case, target).
-- Opportunities overlap (e.g. slow pages are mostly mobile), so they are NOT additive.
WITH aov AS (SELECT AVG(net_value_inr) AS aov FROM orders),
dev AS (
SELECT device, COUNT(*) AS sessions, SUM(add_to_cart) AS carts,
SUM(checkout_start) AS checkouts, SUM(payment_attempt) AS payments, SUM(purchase) AS orders
FROM session_funnel WHERE device IN ('mobile', 'desktop') GROUP BY device
),
h1 AS ( -- H1: mobile cart->payment rate closes half the gap to desktop
SELECT 'H1 Mobile checkout UX' AS lever,
'mobile cart->payment rate moves halfway to desktop' AS assumption,
m.carts * (((d.payments / d.carts) - (m.payments / m.carts)) / 2) * (m.orders / m.payments) AS extra_orders
FROM dev m, dev d WHERE m.device = 'mobile' AND d.device = 'desktop'
),
ch AS (
SELECT channel, COUNT(*) AS sessions, AVG(product_view) AS view_rate,
SUM(purchase) / NULLIF(SUM(product_view), 0) AS view_to_order
FROM session_funnel GROUP BY channel
),
h3 AS ( -- H3: paid-social product-view rate closes half the gap to the site average
SELECT 'H3 Paid social landing pages' AS lever,
'paid-social product-view rate moves halfway to site average' AS assumption,
p.sessions * ((SELECT AVG(product_view) FROM session_funnel) - p.view_rate) / 2 * p.view_to_order AS extra_orders
FROM ch p WHERE p.channel = 'paid_social'
),
spd AS ( -- H4 is measured WITHIN device to avoid the mobile confound
SELECT device, page_load_ms > 3000 AS slow, COUNT(*) AS sessions, AVG(purchase) AS cvr
FROM session_funnel WHERE device <> 'unknown' GROUP BY ALL
),
h4 AS (
SELECT 'H4 Page speed (<3s)' AS lever,
'slow sessions close half the CVR gap to fast sessions of the same device' AS assumption,
SUM(s.sessions * (f.cvr - s.cvr) / 2) AS extra_orders
FROM spd s JOIN spd f ON s.device = f.device AND s.slow AND NOT f.slow
),
pm AS (
SELECT e.payment_method, COUNT(DISTINCT e.session_id) FILTER (WHERE event_name = 'payment_attempt') AS attempts,
COUNT(DISTINCT e.session_id) FILTER (WHERE event_name = 'purchase') AS successes
FROM events e GROUP BY 1
),
h5 AS ( -- H5: card success rate closes half the gap to UPI
SELECT 'H5 Card payment success' AS lever,
'card success rate moves halfway to UPI' AS assumption,
c.attempts * ((u.successes / u.attempts) - (c.successes / c.attempts)) / 2 AS extra_orders
FROM pm c, pm u WHERE c.payment_method = 'card' AND u.payment_method = 'upi'
),
allh AS (SELECT * FROM h1 UNION ALL SELECT * FROM h3 UNION ALL SELECT * FROM h4 UNION ALL SELECT * FROM h5)
SELECT lever, assumption,
ROUND(extra_orders) AS extra_orders_per_quarter,
ROUND(extra_orders * aov.aov / 1e5, 2) AS extra_revenue_lakh_per_quarter,
ROUND(extra_orders * aov.aov * 4 / 1e5, 1) AS extra_revenue_lakh_per_year,
RANK() OVER (ORDER BY extra_orders DESC) AS priority
FROM allh, aov
ORDER BY priority;Building in public
A new end-to-end project every week, committed daily. This log updates as the work ships.
Experience
Nov 2024 – Jul 2026 · Dubai, UAE
Jun 2023 – Aug 2024 · Hyderabad
May 2022 – May 2023 · Hyderabad
Skills
Contact
Open to Data Analyst roles and freelance analytics work. Email is the fastest way to reach me.
Rahman's assistant
Answers about my skills, projects & experience