0

Because we are sending emails in multiple languages, I need to set a look up function that finds the country code (en-US, it-IT, etc) inside my content data extension first to then determine how to display the number which is coming from a different data extensions using looping. Is this possible?

I have tried the following but no luck:

%%=FormatNumber(Field(@row, "clickouts"),"N0","(Lookup(@de_content,"number_format", @contact_language_column, @contact_language))")=%%

FYI here is ampscript setting in beginning so you can see where the lookup columns are set:

%%[var @contact_language_column, @contact_language, @de_content, 
set @de_content = "monthlyperformance_content" 
set @contact_language_column = "contact_language"
set @contact_language = [contact_language]
]%%

And then looping:

%%[
var @rs, @row, @cntr

SET @rs = LookupRows("ITEMS_monthlyperf_august", "account_id", account_id)

for @cntr = 1 to RowCount(@rs) do

SET @row = Row(@rs, @cntr)
   ]%%

The error message I am receiving when using the above is:

Unable to generate preview There is an error in your email. Please contact your customer service representative. Error 1: Invalid Function Call
Invalid characters appear at the end of the parameter value Function Call: FormatNumber(Field(@row, "clickouts"),"N0","(Lookup(@de_content,"number_format", @contact_language_column, @contact_language))") Parameter Value: (Lookup(@de_content, Invalid Character: n
Invalid Content:
FormatNumber(Field(@row, "clickouts"),"N0","(Lookup(@de_content,"number_format", @contact_language_column, @contact_language))")

Update: When attempting the answer below I received this message:

An error occurred when attempting to evaluate a FormatNumber function call. See inner exception for details. Function Call: FormatNumber(Field(@row, "clickouts"),"N0","@CultureCode")

StackID: 6 EnterpriseID: 6172748 ClientID: 6184299 Client Database ID: 664 Account Type: BUSINESS_UNIT JobID: 0 SubscriberID: 105690014 Content Type: HTML MachineName: IND1S06WWW06

An error occurred when attempting to retrieve the culture's numeric format for a FormatNumber function call. The passed culture value may not be valid. The third parameter value for a FormatNumber call must be a recognized culture name such as en-US, en-GB, es-ES, fr-FR, de-DE, or ja-JP. See inner exception for detail. Culture: @CultureCode

Culture is not supported. Parameter name: name @CultureCode is an invalid culture identifier.

1

Thank you everyone for your help! We got an answer!!!

I ended up using this idea:

var @CultureCode

SET @CultureCode = Lookup(@de_content,"number_format", @contact_language_column, @contact_language)

%%=FormatNumber(Field(@row, "clickouts"),"N0", @CultureCode)=%%

BUT for it to work, I just had to take the quotes off from around @CultureCode in the FormatNumber call (in original answer). I also needed to import the local code itself as Data Type 'Locale' in the data extension. Very exciting now!!!

0

From your comments,

  • The reason why the intial error was thrown is that the system could not resolve the lookup function as it did not exist within the data extension.

Try this

var @CultureCode

SET @CultureCode = Lookup(@de_content,"number_format", @contact_language_column, @contact_language)

%%=FormatNumber(Field(@row, "clickouts"),"N0","@CultureCode")=%%
  • Hi! It is not NO , it is N - Zero :) and the number_format column does exist in the data extension - but it is a different data extension than the other part of the call requires (number_format exists in 'de_content' and clickouts exists in 'ITEMS_monthlyperf_august' – A.Malone Aug 21 '17 at 11:17
  • Ahh I like this idea! But I am still getting an error. I believe it is not reading the content correctly - i tried importing it as it-IT & "it-IT" & (it-IT) and still nothing ;( – A.Malone Aug 21 '17 at 15:07

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.