I’d like to return a description column value when the values of 2 other columns in that row match the values I set earlier in the code with set @value1 = “X” and set @value2 = “Y”

For example:

set @model = "ABC"

set @offer_value = "XYZ"

set @offer = Lookup("OfferLookup","description","offer",@offer_value)

but then also make sure it matches the column model with the value I set for model.

So return the value in the column "description" only when the "offer" column has "XYZ" AND the "model" column has "ABC".

Is the Lookup function what I should be using for this type of value return, or is this even possible?


It is possible with Lookup function:

set @model = "ABC"

set @offer_value = "XYZ"

set @offer = Lookup("OfferLookup","description","offer",@offer_value, "model", @model)

You can check the Lookup function syntax here.


5a: Additional column name that identifies the row to retrieve

5b: Additional value that identifies the row to retrieve

NOTE: Additional pairs of columns and values can be appended as arguments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.