I don't recall if this feature is in v9 or not:
Give a a meaningful name (e.g. First2000)
Do not put anything in the expression (Monarch will put 1 in there)
Select the Advanced Tab
At the bottom of that tab is a section called Row Count Limit.
Select First and input 2000 in the box provided.
Your data should now show the first 2000 records.
If the above is not available, use the RecNo() for your filter:
The nice thing about this filter is that you can make the 2000 a runtime parameter and dynamically change the number of exported entries.
Here's the help entry on RecNo():
Returns the record number of a record in the table. You can think of the record number as the detail line number, since any given record number will always correspond to the same detail line from the report (e.g., Recno=1 always corresponds to the first detail line extracted from the report, and Recno=12 always corresponds to the 12th detail line, etc.). This applies even if the table has been sorted. This is not the case for the row numbers that you see at the left edge of the table.
Hope that helps!
You mnetion that the table has already been filtered.
Therefore, you'll need to either add this advanced condition (First x rows) to the existing filter, or create a compound filter to get the results you need. On its own, you'd get the firxt x rows from an otherwise unfiltered table...
Thanks to both of you for the replies!
I have used the Row Limit in the Advanced Filter Tab before and that would work very well here but I was trying for something dynamic where I could pass the number from another source.
As I understand the Recno() function, I have already filtered and sorted the file so the Recno() results are pretty random.
A little cumbersome but I was thinking of exporting the entire table (after filtering and sorting) with the Rowno(). Then re-import the file and the Rowno() would then simply be a sequential number that I could filter on.
I'll keep messing with it to see what I can come up with. If anyone can think of anything else, please let me know.
Thanks again for your help!!
It all depends on what you mean by "pretty random".
If there's a legal/audit requirement for the selection to be genuinely random and not to be possibly determined by report layout, filter and sort calculation, then Monarch does include the Rand() function.
You can use this to assign a random number between 0 and 32767 to each record, and use functions / filters / row count limits based on this to export your subset.