I would like to be able to do the following in a single AMPscript variable:
- set the format (FormatNumber)
- set a value for blanks (IF EMPTY)
- pull it in from a synchronized Data Extension(LookupOrderedRowsCS and Rows)
When compiling the values I have used the following code, but this doesn't appear to be working.
What is the best way to achieve this? Going forward, how would I use more than one function in conjunction?
Var @accountId, @Number, @row, @accountRows
Set @accountId = AccountId
Set @accountRows = LookupOrderedRowsCS('ent.Accounttable', 1, 'Id', 'Id', @accountId)
Set @row = row(@accountRows,1)
Set @Number = (FormatNumber (field(@row,"Number__c")"F0")
If EMPTY(@row) Then
Set @Number = "NA"
Else
Set @Number = (FormatNumber (field(@row,"Number__c")"F0")