我在尝试在 DE 中组合多行时遇到问题。例如,我想获取以下数据(策略数据)并组合策略编号相同的数据,并在电子邮件中显示该信息。我在下面也复制了我的 AMPscript。
Policy_data
Policy_Number|First_Name|Relationship
1111|Steve|Primary
1111|Mary|Spouse
1111|Dave|Child
1111|Wendy|Child
2222|Morgan|Primary
2222|Tom|Child
3333|Greg|Primary
4444|Kayla|Primary
<html>
…
Hi, your policy has the following members:
<table>
%%[
set @rows = LookupRows(Policy_Data,Policy_Number,Policy_Number)
set @rc = RowCount(@rows)
for @i = 1 TO @rc DO
set @row = Row(@rows, @i)
set @fName = Field(@row, first_name)
set @relationship = Field(@row, relationship)
]%%
<tr><td>%%=v(@fName)=%%</td><td>%%=v(@relationship)=%%</td></tr>
%%[next @r]%%
%%[end]%%
</table>
</html>
想问问有没有人有过类似的经历?
谢谢!