Hey folks, Could use the assistance by those smarter than me!
Each sales person sells 2 categories. There are 2 products in each category. Trying to find a way to return the Top 2 largest values for each product:
Red Delicious Apple Highest Sales = John Smith
Red Delicious Apple 2nd Highest Sales = Bob Smith
Orange Valencia Highest Sales = Bob Smith
Orange Valenicia 2nd Highest Sales = John Doe (A tie doesnt matter so long as highest and 2nd highest reflect the tie).
Was thinking just an index with large function. Not worried about aesthetics (i can clean up on the formatting and the way it returns, just need function assistance) Help is appreciated, thanks!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Product[/TD]
[TD]Type[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Apple[/TD]
[TD]Red Delicious[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Apple[/TD]
[TD]Granny Smith[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Orange[/TD]
[TD]Valencia[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Orange[/TD]
[TD]Clementine[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Apple[/TD]
[TD]Red Delicious[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Apple[/TD]
[TD]Granny Smith[/TD]
[TD]16[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Orange[/TD]
[TD]Valencia[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Orange[/TD]
[TD]Clementine[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Each sales person sells 2 categories. There are 2 products in each category. Trying to find a way to return the Top 2 largest values for each product:
Red Delicious Apple Highest Sales = John Smith
Red Delicious Apple 2nd Highest Sales = Bob Smith
Orange Valencia Highest Sales = Bob Smith
Orange Valenicia 2nd Highest Sales = John Doe (A tie doesnt matter so long as highest and 2nd highest reflect the tie).
Was thinking just an index with large function. Not worried about aesthetics (i can clean up on the formatting and the way it returns, just need function assistance) Help is appreciated, thanks!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Product[/TD]
[TD]Type[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Apple[/TD]
[TD]Red Delicious[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Apple[/TD]
[TD]Granny Smith[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Orange[/TD]
[TD]Valencia[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Orange[/TD]
[TD]Clementine[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Apple[/TD]
[TD]Red Delicious[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Apple[/TD]
[TD]Granny Smith[/TD]
[TD]16[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Orange[/TD]
[TD]Valencia[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]Bob Smith[/TD]
[TD]Orange[/TD]
[TD]Clementine[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Last edited: