I am currently fetching data from a data extension using AMPscript where I have multiple records for a single user. So some users may 3 records and some may 8 records. Using the below code it shows all the records for the user but I want if the user has more than 5 records then it will show only 5.
So if the first user has 3 records it will show 3 and if the second user has 8 records it will show 5. Hope that makes sense! Can anyone help me on this. Thanks.
%%[
if @rowCount > 0 then
for @i = 1 to @rowCount do
var @report_owner, @report_link, @report_type
set @row = row(@rows, @i)
set @report_owner = field(@row,"report_owner")
set @report_link = field(@row,"report_link")
set @report_type = field(@row,"report_type")
set @report_owner2 = "Update done"
]%% <br>
%%=v(@report_owner2)=%%
%%[ next @i ]%%
%%[ else ]%%
No rows found
%%[ endif ]%%
@rows
.