

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get a simple count of rows in a table
Hello Everyone,
I'm trying to find a simple way to make my table title show the number of rows in the current selection.
Usually I just count one of my ID fields such as count(MY_ID), but I'm looking if there is a built in function I can use instead?
Similar to the "Sum of Rows" feature for an expression, just need a simple count of the number of rows that are shown on screen.
Does QV have a built in function for this sort of thing or anyone have any ideas?
The dataset is large with 6million+rows.
Thanks,
Peter.
- « Previous Replies
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter
The RowNo() function should provide this, so you can create your caption such as:
="This is my title, and there are this many rows: " & RowNo()
RowNo() without any parameters should give you total number of rows in the table.
Good luck,


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nigel,
Thanks for the reply, that was the sort of thing i was looking for - however i cannot get it to work, it allways returns 1.
I've used rowno() in the past in scripts to assign i row ID, but in the developer it seems to only return the number 1.
Peter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having trouble with this function as well. Were you ever able to find an answer to this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there, try using the total qualifier, like this:
rowno(total)
That should do the trick.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That worked! Thank you!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
When I have tried to use either RowNo(total) or NoOfRows(total) in the chart caption, it always comes back with 1. Add it as an expression in the chart and it shows the correct value.
Any ideas?
Thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can try to set a counter in the script:
'1' as RowCounter
Very simple


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not using a simple count on a field, which is available in all records?
='This table has ' & COUNT(Keyfield) & ' records'
HTH
Peter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for that, but I am wanting to count the number of records displayed in the table.
The expressions has a formula which sets unwanted records to null thereby not showing certain records. I wanted to show the total number of records actually shown. The same would apply if a table is shown and one or more fields have the 'Omit row when field is null'
Any suggestions

- « Previous Replies
- Next Replies »