Is there a FX formula to display the total number of lines within a table, that is auto populated from a lookup? The idea is to provide the end user, to be able to see the total lines generated at a quick glance.
Discussion
Discussion
Steve, the max(table.rowid) is fine to count rows but is there a way to countif? eg. table.variable=blah in two of three rows. countif(table.variable,"=blah") would return 2? i've tried that and the help shows the example of an array [2,2,1] countif "=2" (actually they show > 1 now i think of it). I can't get it. The requirement is for an attribute in the table to select a value in the row, i need the count of rows if value = some text or a number.
Hi Shan
Add a new Number Field to your Table called ROWID. In that field put the Formula =ROW()
If you preview the Table you will see that this field will have the number of each ROW for each line of the table.
Then in a field outside the table (ie: Number of Rows in Table), put the formula =MAX(tablename.ROWID)
You can Hide this field by a rule if you choose
Hi Steve,
Thanks for the post. I have tried myself however what am I missing here? I have the table populating from a lookup, and a user can add new rows. But the formula doesn't seem to work at all.
Any pointers apprecaited!
Hi Tom
The easiest way is if you can perform a COUNTIF on one of the Table Row variables that always contains a value. Using a field outside the table, it could look like =COUNT(Table.variable) or =COUNTIF(Table.variable,">0")
Beyond that, you would need to use Javascript, there are a couple examples such as this in answers
https://answers.laserfiche.com/questions/116014/How-to-count-the-number-of-rows-in-a-table#143459