February 12, 2015 at 8:49 am
sonchoix (2/12/2015)
dwain.c (2/11/2015)
In the TOP 2 or 3 or 4 you are listing (outside of the Others group), what do you want to do if there are ties?This looks to me like a TOP 5 customers report or something, and while it is unlikely that you'd get a tie on revenue by customer, it is not entirely inconceivable and you wouldn't want to give a customer short shrift and knock them out of the rankings just because there was coincidentally a tie.
I appreciate your reply, at this moment, there is no need to over complicate the case, but you indicate a very important point and I will definitely keep that in mind later.
Thanks.
There's nothing complicated on adjusting the code for this, you just need to use a different Ranking function. 😉
February 23, 2015 at 5:35 pm
Luis Cazares (2/12/2015)
sonchoix (2/12/2015)
dwain.c (2/11/2015)
In the TOP 2 or 3 or 4 you are listing (outside of the Others group), what do you want to do if there are ties?This looks to me like a TOP 5 customers report or something, and while it is unlikely that you'd get a tie on revenue by customer, it is not entirely inconceivable and you wouldn't want to give a customer short shrift and knock them out of the rankings just because there was coincidentally a tie.
I appreciate your reply, at this moment, there is no need to over complicate the case, but you indicate a very important point and I will definitely keep that in mind later.
Thanks.
There's nothing complicated on adjusting the code for this, you just need to use a different Ranking function. 😉
I suspect this is a homework problem.
----------------------------------------------------
February 23, 2015 at 5:39 pm
CELKO (2/12/2015)
it is not entirely inconceivable and you wouldn't want to give a customer short shrift and knock them out of the rankings just because there was coincidentally a tie.
I was looking at some of my old stuff, and realized that ROW_NUMBER() should have been DENSE_RANK() more often than not :crying:
I will certainly keep this in mind the next time I think I need to use ROW_NUMBER()
----------------------------------------------------
February 23, 2015 at 8:09 pm
Heh... deleted my post. I was having too much fun. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply