Counting records
There are two main functions used to count records during load: RecNo()
and RowNo()
. After the data has been loaded, we can use another couple of interesting functions: FieldValueCount()
and NoOfRows()
. There is also a useful function, NoOfFields()
, that tells us how many columns there are in a table.
RecNo
The RecNo()
function gives us the number of the rows in the source table. While the output of the RecNo
function will always be guaranteed to be ordered, there might be gaps in the sequence because rows may be excluded due to a where clause, for example, this load
statement:
Table1: Load *, RecNo() As RecNo1 Where Field1<>'C'; Load * Inline [ Field1 A B C D ];
Only three rows will be loaded from the source because the row with C
as a value is excluded by the Where
clause. This results in this table:
Field1 |
RecNo1 |
---|---|
A |
1 |
B |
2 |
D |
4 |
The value 3
is missing in the sequence as the third row was not loaded.
It should also be noted that an additional load from a new source...