Menu
hardZalora · experimentationBasic

Revenue per user, before and after trimming

Zalora tested a personalised recommendations rail. Revenue per user is a heavy-tailed metric: a single stylist buying a season's stock can move a variant's mean on its own, and which arm that buyer happens to land in is luck, not treatment effect. The usual defence is to trim the extreme tail before comparing.

From user_revenue (2,000 users), return each variant with:

- mean_revenue — the plain average, rounded to 4 decimal places - trimmed_mean — the average over only those users at or below that variant's own 99th percentile of revenue, rounded to 4 decimal places

Order by variant.

Schema

user_revenue
user_idINT
variantTEXT
revenueNUMERIC(10,2)

Basic

The example input, expected output, and walkthrough for this question unlock with a Basic plan.

↑ Read the question

Basic

This is a Basic question

Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.

See Basic plans

RM 25/mo · cancel anytime

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.