I wanted some help for an AMPscript function where i get an error. I have a data extension with some information like : Number of points Amount Transations
I need to display on this email the amount of money they need to go on the next step (like VIP)
So i need to do two functions :
- 5000 - Number of points = Number of points that i need to go on the next step
- Number of points that i need to go on the next step / 20 = amount of $ that i need to spend to go on the next step.
I have this AMPscript :
SET @rowSet = LookupOrderedRows("Loyalty", 0, "Points Asc", "SubscriberKey", _SubscriberKey) SET @rowCount = rowcount(@rowSet) for @i = 1 to @rowCount do var @nombrePointsCumul, @montantTotalTransactions, @pointManquant, @dollarManquant SET @row = row(@rowSet, @i) SET @nombrePointsCumul = field(@row,"Points") SET @montantTotalTransactions = field(@row,"Transactions") SET @pointManquant = Subtract(5000, @nombrePointsCumul) SET @dollarManquant = Divide(@pointManquant, 20) next @i