how can i get the top 3, after i count the column ?

  • Luis Cazares - Tuesday, July 17, 2018 6:19 AM

    Jeff Moden - Tuesday, July 17, 2018 6:12 AM

    Folks are still forgetting about "ties".  If you have a dozen ties for 1st, 2nd, or 3rd, is it actually appropriate to ignore such ties or should (must) they be considered?

    Sometimes, you only have space for 3. Is it appropriate? Probably not.

    That's what I'm trying to get the OP to define.  And what should the sort order be if you only have space for 3?  If that sort order doesn't matter, then why bother to begin with?  "We need the top 3", says the OP.  Uh huh... and what the hell are you going to do with that once you have it, says I. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Tuesday, July 17, 2018 6:47 AM

    Luis Cazares - Tuesday, July 17, 2018 6:19 AM

    Jeff Moden - Tuesday, July 17, 2018 6:12 AM

    Folks are still forgetting about "ties".  If you have a dozen ties for 1st, 2nd, or 3rd, is it actually appropriate to ignore such ties or should (must) they be considered?

    Sometimes, you only have space for 3. Is it appropriate? Probably not.

    That's what I'm trying to get the OP to define.  And what should the sort order be if you only have space for 3?  If that sort order doesn't matter, then why bother to begin with?  "We need the top 3", says the OP.  Uh huh... and what the hell are you going to do with that once you have it, says I. 😉

    There are legit cases where the order of things at the same priority don't matter, but the overarching priority does. Only the OP can say for certain if that applies here.

  • andycadley - Sunday, July 22, 2018 1:09 AM

    Jeff Moden - Tuesday, July 17, 2018 6:47 AM

    Luis Cazares - Tuesday, July 17, 2018 6:19 AM

    Jeff Moden - Tuesday, July 17, 2018 6:12 AM

    Folks are still forgetting about "ties".  If you have a dozen ties for 1st, 2nd, or 3rd, is it actually appropriate to ignore such ties or should (must) they be considered?

    Sometimes, you only have space for 3. Is it appropriate? Probably not.

    That's what I'm trying to get the OP to define.  And what should the sort order be if you only have space for 3?  If that sort order doesn't matter, then why bother to begin with?  "We need the top 3", says the OP.  Uh huh... and what the hell are you going to do with that once you have it, says I. 😉

    There are legit cases where the order of things at the same priority don't matter, but the overarching priority does. Only the OP can say for certain if that applies here.

    Agreed... what we're trying to do is get the OP to identify that.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply