LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Vlookup TRUE equivalent

    Employee
    Posted 08-11-2014 09:34

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: svimes

    I assume the answer is no as this is how databases work. I want to do an equivalent of an excel VLOOKUP(,,,TRUE).

    I have source LEFT with field L_Mark which contains numbers, say exam scores
    Source RIGHT which has fields
    a) R_Tier and which show the mark required to hit a certain grade
    b) R_Grade the corresponding Grade for each tier


    How do I return R_Grade for each L_Mark?

    Obviously to make it more like life, source RIGHT may change and have different number of tiers.

    a Vlookup(,,,TRUE) in excel would do this.


  • 2.  RE: Vlookup TRUE equivalent

    Employee
    Posted 08-11-2014 10:07

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Short answer, YES it's possible.
    To make this a better answer and more directly to your needs, could you post the data for your right input, and a couple of records from the left side?
    If it is customer-sensitive data that you don't want public, you could either remove the identites, or you could sent it to ssmith@lavastorm.com


  • 3.  RE: Vlookup TRUE equivalent

    Employee
    Posted 08-11-2014 10:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: svimes

    Actually got it.

    have two extra columns, upper and lower. do a join on 1 /1 both sides and a where clause of mark > than lower and mark <= upper


  • 4.  RE: Vlookup TRUE equivalent

    Employee
    Posted 08-11-2014 10:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Yes, that is the exact suggestion I was going to give you.

    Just be aware of one thing.. if the Left and Right sides both contain lots (tens of millions) of records, this method can cause a memory problem, but for small record counts (less than 100,000) it's no problem.