0

I have a DE which has a tickbox field with boolean value of true set all the time.Now i want to get the total no of rowcount of my de by using this defaul value set@neededNumber=RowCount(LookupRows("TableName","TickBox","true"))

But it doesnt seem to be working.Is there some syntax error here and also is there any other way of getting the no of rows of your data ,I need in a landing page to make a incremental id.Thank you.

1
  • Is it a typo in your question - or do you indeed not have a space between SET and @? Commented Aug 14, 2019 at 13:38

1 Answer 1

4

If you need just the total rowcount of your dataextension, you can utilize DataExtensionRowCount()

In which case you just:
set @neededNumber = DataExtensionRowCount('TableName')

This is optimal as Lookups cap out at around 2500 and are much heavier with processing creating longer and unnecessary time sucks. This is because the lookups will pull all the data associated with the records, not just count them.

if you want your above ampscript to work, I would try the following:
set @neededNumber = RowCount(LookupRows("TableName","TickBox","true"))
(adding in spaces appropriately)

If this still returns error or 0 records, try below:
set @neededNumber = RowCount(LookupRows("TableName","TickBox",true))

by removing the quotes around the value in the lookup, you set it to boolean not string, which should help make the return more accurate if the field type of "TickBox" is boolean.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .