1

I'm looking for a solution for the following topic (not sure if it's even possible but I try): We have two separate DEs, one is storing the email address (the one I sent to) and the other one the values I use in my AMP Script via lookup function.

AMP script looks like this:

%%[
    var @Location, @Language, @replyName, @subscriberkey 
    Set @subscriberkey = PVSID 
    Set @Location = Lookup('Test_Greta_AMP_no_email_Copy','Country','PVSID', @subscriberkey)
    Set @Language = Lookup('Test_Greta_AMP_no_email_Copy','Language','PVSID', @subscriberkey)
    if @Location == "Ukraine" and @Language == "Ukrainian" then
       set @replyName = "Anna" 
    elseif @Location == "Ukraine" and @Language == "English" then
       set @replyName = "Greta"
    else
       set @replyName = "SORRY" 
    endif
]%%

(test version at the moment)

The Problem now is that PVSID, which I set as subscriber key, is the unique identifiier and available in both the Data Extensions, however, due to the company structure, the column name of this identifier is named different in the DEs - in one its "PVSID" in the other one "BPID", the values are the same.

Is there any solution for that, like setting two different names for the subscriber key or sth??

Thank you!

  • If the subscriberkey is the same value in both DEs, why would you not simple query both dataextensions, one with PVSID as subscriberkey column and one with BPID as subscriberkey column. Then compare them or only take the value which is filled with data or something like that. Or i have completly missunderstood your question and you need to clarify it. – Johannes Schapdick Apr 8 at 14:36
0

First of all, you have two Lookup functions on the same data extension in your AMPscript. Instead of doing an unnecessary second Lookup, just use LookupRows and get your Country and Language values.

Second, you have the same SubscriberKey value but different columns, you can just perform a Lookup on that second data extension. It looks like the email address data extension that you're referring to is your sendable data extension. Then you'll just need to perform a LookupRows on your second data extension for the Country and Language values.

%%[
set @subscriberKey = [SubscriberKey]

set @lookupRowSet = LookupRows("Test_Greta_AMP_no_email_Copy", "PVSID", @subscriberKey)
set @lookupRowCount = RowCount(@lookupRowSet)

if @lookupRowCount > 0 then
   set @lookupRow = Row(@lookupRowSet, 1)
   set @language = Field(@lookupRow, "Language")
   set @country = Field(@lookupRow, "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.