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.

  • Is it a typo in your question - or do you indeed not have a space between SET and @? – Lukas Lunow Aug 14 at 13:38
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.

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.