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.