You can't do a lookup without specifying a value. I'd recommend adding a lookupKey
column to your data extension and giving it a default value of 1
.
After you ensure that all rows have the default value, you can utilize it with lookupRows().
Here's an example I did for a client:
%%[
var @rows, @row, @rowCount, @numRowsToReturn, @lookupValue, @i
set @lookupValue = 1
set @numRowsToReturn = 0 /* All */
set @rows = LookupOrderedRows("Master_Summary",@numRowsToReturn,"Action asc","lookupKey", @lookupValue)
set @rowCount = rowcount(@rows)
set @total = 0
if @rowCount > 0 then
for @i = 1 to @rowCount do
var @Count, @Created, @Action
set @row = row(@rows,@i)
set @Action = field(@row,"Action")
set @Count = field(@row,"Count")
set @Created = field(@row,"Created")
set @total = add(@total,@count)
if @i == 1 then
output(concat("<h3>MasterDaily Summary</h3>"))
output(concat("<b>Run Date:</b> ",@Created,"<br><br>"))
output(concat("<table border='1' cellpadding='5' cellspacing='0'>"))
output(concat("<thead>"))
output(concat("<tr>"))
output(concat("<td><b>Action</b></td>"))
output(concat("<td align='right'><b>Count</b></td>"))
output(concat("</tr>"))
output(concat("</thead>"))
output(concat("<tbody>"))
endif
output(concat("<tr>"))
output(concat("<td>",@Action,"</td>"))
output(concat("<td align='right'>",format(@Count,"n0"),"</td>"))
output(concat("</tr>"))
if @i == @rowCount then
output(concat("<tr>"))
output(concat("<td><b>Total</b></td>"))
output(concat("<td align='right'><b>",format(@total,"n0"),"</b></td>"))
output(concat("</tr>"))
output(concat("</tbody>"))
output(concat("</table>"))
endif
next @i
else
raiseError("No counts found")
endif
]%%