I am using the following AMPscript:

SET @c10 = RowCount(LookupRows(@De1,@band,@value10))

to retrieve and set the count of the number of rows in a DE. I have now run into an issue where I need to count and display the number of rows which is greater than 2000 rows. Is there a workaround for counting rows greater than 2000?


The DataExtensionRowCount may help you. This will return the rowcount regardless of size.


If you are looking for a count of a specific subset of your DE, then you will need to look at using the LookupOrderedRows function.

%%=RowCount(LookupOrderedRows("Cars",50000,"Horsepower Desc","MPG",Field(@cardata,"MPG"))=%%

Given you don't know the number of rows in your DE put a number that is definitely bigger and will return only the number that matches your where clause.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.