Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I have my data similar to this:
Where I have multiple stores, selling various products, on different weeks.
What I need is a table where I have the product which sold the most during each week, like this:
The closest I got was
Sum( {$<Sales = {$(=max(Sales))}>} Sales)
But this only gives me the max overall. I need the max for every week.
Keep in mind I have multiple products, the example above is just sample data.
Thanks!
Dimension: Week
Expression:
Top Sales =aggr(max(Sales),Week)
Top Product =FirstSortedValue(DISTINCT aggr( Product, Week, Product) , -aggr(Sum(Sales), Week, Product) )
Dimension: Week
Expression:
Top Sales =aggr(max(Sales),Week)
Top Product =FirstSortedValue(DISTINCT aggr( Product, Week, Product) , -aggr(Sum(Sales), Week, Product) )
Thanks!!
Exactly what I needed.