Krishti Bikal
09/29/2026, 9:11 PMkapa.ai
09/29/2026, 9:11 PMTOP(...) IN (...) WITHIN (...) ranking filter [TOP or BOTTOM(n) IN]. The WITHIN clause partitions the ranking so that it evaluates per seller rather than globally across all sellers [TOP or BOTTOM(n) IN]. 1. Create a Ranked GMV Metric Define a metric in MAQL that calculates GMV only for the top 20 products within each seller: SELECT {metric/gmv} WHERE TOP(20) IN ( SELECT {metric/gmv} BY {label/seller}, {label/product}, ALL OTHER ) WITHIN ({label/seller}, ALL OTHER) In this metric: âĸ BY {label/seller}, {label/product} specifies the dimensionality to evaluate the ranking against [TOP or BOTTOM(n) IN]. âĸ WITHIN ({label/seller}, ALL OTHER) ensures the ranking resets for each seller, returning the top 20 products per individual seller [TOP or BOTTOM(n) IN]. 2. Configure the Visualization 1. Create a table visualization. 2. Add Seller and Product to the rows/attributes. 3. Add your newly created ranked metric to the metrics section. The table will display only the top 20 products for each seller based on their GMV [TOP or BOTTOM(n) IN]. đ 0 button đ 0 button âšī¸ Tip: Mention @kapa.ai in the thread for follow-ups. đ Our Support team monitors all messages and will jump in if needed.Michael Ullock
09/29/2026, 10:47 PM