0

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?

1 Answer 1

2

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.

Lookup(1,2,3,4,[5a,5b]...)

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .