Ideal state, show a calculation of field "@ytd_savings_per_participant" divided by 3 as %%=v(@Lattes)=%% within a dynamic message. The message is based as well on the field "@ytd_savings_per_participant". If the value is under 300 in "@ytd_savings_per_participant" I'd like it to say
"That could buy %%=v(@Lattes)=%% number of Lattes"
I cannot get the variable to populate here. I can get it to pull in outside of the dynamic field but now within. Code below as well as screenshot attached to show the two places I put the %%=v(@Lattes)=%% field.
var @YTDS, @message, @ytd_savings_per_participant, @num2, @Lattes
Set @ytd_savings_per_participant = ytd_savings_per_participant
Set @YTDS = FormatNumber(@ytd_savings_per_participant, "C")
Set @num2 = 3
Set @Lattes = Divide(@ytd_savings_per_participant, @num2)
]%%
%%[if @ytd_savings_per_participant <=299 then
set @message = "With those savings you could buy %%=v(@Lattes)=%% lattés"
elseif @ytd_savings_per_participant >=300 AND @ytd_savings_per_participant <=1000 THEN
set @message = "With those savings you could buy a new flatscreen"
elseif @ytd_savings_per_participant >=1000 AND @ytd_savings_per_participant <=1999 then
set @message = "With those savings you could buy a new sofa"
elseif @ytd_savings_per_participant >=2000 AND @ytd_savings_per_participant <=3000 then
set @message = "With those savings you could buy a family vacation"
ENDIF
]%%
<center>
<br>
<div align="center">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 20px; line-height: 23px;">Dollars Saved Lattes:%%=v(@Lattes)=%%</span> </div><br>
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="background: #ffffff; color: #17A062; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; line-height: 28px; padding: 15px 25px 15px 25px;">%%=v(@YTDS)=%%
</td>
</tr>
</table>
<div align="center">
<span style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 20px; line-height: 23px;">
<br>%%=v(@message)=%%¹
</span>
<br><br>
<span style="font-family: Tahoma,Geneva,sans-serif; color: #FFFFFF; font-size: 14px; line-height: 16px;">
Get an estimate of your other savings<br> with our calculator.
</span>
<br><br>
</div>
</center>
In the above code you can see I put the value %%v(@Lattes)=%% in 2 places to test if it would work. It only pulls in when outside of the variable message