0

I'm struggling a little with a lookup table.

so I have a list. List has country and language columns

I also have an exception table that has country and language columns.

I am trying to say, If Country = Germany in my list and Country Germany is found in the lookup table, then Set the language to whatever the value is in the lookup table, else just use the values from the list if Country is not found in the exception table

%%[

Var  @excepcount, @exceplang, @count, @lang, @row, @rows, @country,@language, @rowcount

Set @count = AttributeValue("country")
Set  @lang = AttributeValue("language")





Set @rows = LookupRows("exceptions", "country", @count)
set @rowCount = rowcount(@rows)

if @rowCount > 0 then

set @row = row(@rows,1) 
set @exceplang = field(@row,"language")
set @excepcount = field(@row,"country")



else

Set @exceplang = AttributeValue("language")
Set @excepcount = AttributeValue("country")



endif
]%%
0

solved it

%%[

Var  @excepcount, @exceplang, @count, @lang, @row, @rows, @country, @language, @rowcount

Set @count = AttributeValue("country")
Set  @lang = AttributeValue("language")





Set @rows = LookupRows("exceptions", "language", @lang)
set @rowCount = rowcount(@rows)

if @rowCount > 0 then

set @row = row(@rows,1) 
set @exceplang = field(@row,"language")
set @excepcount = field(@row,"country")

else 

Set @exceplang = language
Set @excepcount = country



 endif ]%%

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.