2 Replies Latest reply: Nov 28, 2014 11:59 AM by Fabiola Zelaya

# Need top results by dimension and sorted by expression. Necesito top resultados (dimensión) ordenados (Expresión).

Basically I need to show top 10/20/30 EAN (Dimension) sorted by the field 'Opportunity Trans Cost' (Expression). In my example I have an opportunity of 72.391 because it is the highest, but I want to show right below the results of the same EAN and then jump into the next highest opportunity. In this case the following is 30.015 and so on.

Example attached.

Básicamente lo que pretendo es que me muestre el top 10/20/30 EAN ordenados por el campo ‘OPPORTUNITY - TRANS COST’. Es decir, en el ejemplo que tenemos 72.391 de opportunity, como es el mayor de todos quiero que me muestre ese EAN el primero aunque el resto de opportunity relacionados a ese EAN sean importes mucho más pequeños. Después el de 30.015 con sus correspondientes EAN y así sucesivamente.

Gracias por vuestra ayuda

• ###### Re: Need top results by dimension and sorted by expression. Necesito top resultados (dimensión) ordenados (Expresión).

I sorted by EAN with the expression as follows. This will aggregate the opportunity trans cost at the SKN level and take the max for each EAN .  So the EAN's will be grouped together starting from the EAN that has SKN with the highest value in the data set.

Next i sorted by  opportunity trans cost by 'numeric value'

max(aggr(

((sum(PRJSALES)-sum(SALESTY)-Sum(INVENTORY))*[NET_COST_EUR])-(sum(PRJSALES)-sum(SALESTY)-Sum(INVENTORY))*([MIN NET COST €]+([AVG. COST PER FT3]*[MAX CUBE])),

SKN))

• ###### Re: Need top results by dimension and sorted by expression. Necesito top resultados (dimensión) ordenados (Expresión).

Thanks so much Jonathan!!! You are a genious. I was going crazy trying to find out how to solve this issue. I guess I can filter now by the top 'x' EANs to get my final report done, right?

Again, thank you for your help!!!