I am trying to conditionally display rows in a table. However it seems like the once the code reaches a record where the condition "IF IndexOf(@ClientContent, @MPEContent) > 0 AND IndexOf(@ClientLanguage,@MPELanguage) > 0
" is no longer met it stops.
I'm guessing I have this condition in the wrong place within the code:
%%[
var @IndexEquity, @OverUnderweightEquity, @PositioningEquity, @AllRecordsEquity, @RowCountEquity, @MPEContent, @MPELanguage
set @AllRecordsEquity = LookupOrderedRows("Weekly Indices", 2000, "Sort_Order__c Asc", "Content_Block__c", "Managed Portfolios", "Index_Category__c", "Equity")
set @RowCountEquity = rowcount(@AllRecordsEquity)
SET @ClientContent = [Newsletter_Content__c]
SET @ClientLanguage = [Newsletter_Language__c]
]%%
<table id="stocks" cellpadding="6" cellspacing="0" width="100%" style="border: 1px;" rules="none">
<tr bgcolor="#dddddd">
<th width="35%" style="border-bottom:1px solid #00008B;">Stocks (Equities)</th>
<th width="10%" style="border-bottom:1px solid #00008B;"></th>
<th width="55%" style="border-bottom:1px solid #00008B;">Rationale</th>
</tr>
%%[
IF @RowCountEquity > 0 THEN
FOR @i = 1 TO @RowCountEquity DO
set @IndexEquity = Field(Row(@AllRecordsEquity,@i),"Name")
set @OverUnderweightEquity = Field(Row(@AllRecordsEquity,@i),"OverUnderWeight__c")
set @PositioningEquity = Field(Row(@AllRecordsEquity,@i),"Managed_Portfolio_Positionning__c")
set @MPEContent = Field(Row(@AllRecordsEquity,@i),"Content__c")
set @MPELanguage = Field(Row(@AllRecordsEquity,@i),"Language__c")
IF IndexOf(@ClientContent, @MPEContent) > 0 AND IndexOf(@ClientLanguage,@MPELanguage) > 0 THEN
]%%
<tr>
<td style="border-bottom:1px solid #00008B;"> %%=v(@IndexEquity)=%% </td>
<td style="border-bottom:1px solid #00008B;"> </td>
<td style="border-bottom:1px solid #00008B;"> %%=v(@PositioningEquity)=%% </td>
</tr>
%%[
ENDIF
NEXT @i
ELSE
No Rows Found
ENDIF
]%%
</table>