I'm extremely new to using AMPScript, and wonder if any of you AMPScript savvies can help me.
I am trying to create an AMPScript inside of an AMPScript.
The point to this HTML is to present the user a graph of his last 5 weeks of stats.
If the user doesn’t have stat for 5 weeks but only 4 or 3 or 2 the stat’s graph will present only the weeks he have stat in.
In my DE I have a column of flag_weekstart
that helps me to determine how many weeks to present in the graph.
The 5Total
attribute represent the total stat a user has in week number 5 (5 weeks ago).
I am using this code:
%%[
VAR @5Total
SET @5Total = AttributeValue("5Total")
VAR @weekstart1
IF [flag_weekstart] == "5" THEN
SET @weekstart1 = '
<table width="90%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="20%" style="">
<span style="">Aug 28</span>
</td>
<td width="20%" style="">
<span style="">Sep 04</span>
</td>
<td width="20%" style="">
<span style="">Sep 11</span>
</td>
<td width="20%" style="">
<span style="">Sep 18</span>
</td>
<td width="20%" style="">
<span style="">Sep 25</span>
</td>
</tr>
</table>
<table width="90%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%" style="">
<span style=""><center>Total Measurements</center></span>
</td>
</tr>
</table>
<table width="90%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="20%">
<span style=""><center>%%=v(@5Total)=%%<br> </center></span>
</td>
<td width="20%">
<span style=""><center>%%4Total%%<br> </center></span>
</td>
<td width="20%">
<span style=""><center>%%3Total%%<br> </center></span>
</td>
<td width="20%">
<span style=""><center>%%2Total%%<br> </center></span>
</td>
<td width="20%">
<span style=""><center>%%1Total%%<br> </center></span>
</td>
</tr>
</table>'
]%%
The code is continuing with:
IF [flag_weekstart] == "4" THEN
…
Until 1.
I tried puling the 5Total
attribute using %%=v(@5Total)=%%
and %%5Total%%
with no luck.
The value I am getting is %%5Total%%
like the AMPScript doesn't know from where to pull the data from.
Any ideas?