Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning to all,
I'm trying to show the best seller product among different categories.
I was wondering if it's possible to sum all the sales for each category and then show the product the company should focus on.
I'm trying with an expression like this :
concat(distinct IF(aggr(rank(Sum([Fatturato])), Fatturato )=1,Aggr(rank((Sum([Fatturato])), Prodotto )=1)&CHR(13))
but it's not working.
Does a different solution exist?
hello,
i find strange this part of the expression :
aggr(rank(Sum([Fatturato])), Fatturato )=
I would try
sum values by product and category
find max valus of each category by using firstsortedvalue
Thank you for the answer, I tried with this one:
concat(distinct IF(FirstSortedValue(Sum({<Anno={$(vSelAnno)},[LIVELLO 1 - ECR]={'*FRESCO*'}, [Famiglia Az Comm]={'*LATT*'}>} Fatturato),Prodotto),FirstSortedValue(Sum({<Anno={$(vSelAnno)},[LIVELLO 1 - ECR]={'*FRESCO*'}, [Famiglia Az Comm]={'*LATT*'}>} Fatturato),Prodotto)&CHR(13),'-'))
Probably I make some mistakes in the logic of the expression, because it's not working, this expression: Sum({<Anno={$(vSelAnno)},[LIVELLO 1 - ECR]={'*FRESCO*'}, [Famiglia Az Comm]={'*LATT*'}>} Fatturato) shows me the total amount of the sales when showed by itself.
can you do it in a load statement (that was my idea) so you have directly the best sellers
calculate the rank of each product in its category
and in your visualization, select only contributors with rank 1