I made a pivot table that shows the max amount of week sales of a shop that belongs to a branch. (rows - branches, columns - week numbers). Right now i made a function Max(aggr(Sum(Sales), week, branch, IdShop)). This shows sales numbers, but i want to show the IdShop, who made those max sales. How do i do that? I tried to do "If(Max(aggr(Sum(Sales), week, branch, IdShop)), IdShop), but it shows only one single shop, and i need to "replace" sales numbers to the IdShop, that made those sales.