Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello. I hope someone can help me.I want to load the last n rows from a table in excel.How can i do that?
You have to load all table first then, use the NoOfRows('table') Function to know how many rows there is in the table and store it in a variable, like
LET a = NoOfRows('tab1');
then load it again with a "where RowNo() > $(A-N)" statementYou have to load all table first then, use the NoOfRows('table') Function to know how many rows there is in the table and store it in a variable, like
LET a = NoOfRows('tab1');
then load it again with a "where RowNo() > $(A-N)" statementThanks for the reply.It seems that there in no way to avoid the first load.
Hi konstantinos,
do you know how many rows you want to load? You can use the header size with a variable and then load the titleline with the fieldnames to rename all fileds.
Hi Martina,
thanks for the reply.Unfortunately i don't know the number of rows.
Hi, konstatntinos,
how do you find them out? Did you try the possibilities of Enable Transformation Step? there you can enter conditions to find the right lines to load?!
Hi Martina,
the only condition is that the rows must be the last n in the table. I tried the Transformation step but since the number of rows is not fixed i did n't find something that will do the job on any case.
Hi, konstantinos,
do you know any condition how many n rows you have to load?
Hello Konstantinos,
Maybe not the most beautiful way, but loading the table frist to know the number of rows (I don't know any other way of counting them, but loading it or even -untested- connect via ODBC/OLE DB) then you can use function RecNo() to start loading when RecNo() greater than total rows - n.
Does that suit you?
Hi Martina,
n is a fixed number, e.g n=5. I just need the last 5 records added to a table.