Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to know how to get the last 10 or more record of table?
Please help me.
Thanks in advance..
Regards,
Kabilan K.
If you are using v11 you can use dimension limits. If not, try Rank() with Aggr(). Maybe something like,
Aggr(If(Rank(Sum(Sales))>=Max(Rank(Sum(Sales)))-10,Customer),Customer) as your dimension.
Hope this helps,
Jason
Hi,
To get last 10 records of a table in script you can use First attribute and by using Order the table in descending order.
TableName:
First 10 Load
*
from abc.qvd
Order by Id desc;
Hope this helps you.
There is no direct way to get last 10 records.
Regards,
Jagan.
Hi,
I am using V11, So tell me about dimension limit.
Because, my table doesn't have a any numeric column So This expresion is not work (Aggr(If(Rank(Sum(Sales))>=Max(Rank(Sum(Sales)))-10,Customer),Customer)).
Table is like this:
LOAD @1 as FirstDate, //this field have a date, Some dates are very and some dates are same
@2 as Information, //this field have string as 'Information'
@3 as Basedate // This field have Date and some string value
FROM
[$(FoundFile)]
(txt, utf8, no labels, delimiter is '\t', msq);
Here, how can I get the last 10 record?
Thanks in advance.
Regards,
Kabilan K.
Hi Kabilan,
You can add the RowNo() function in the table and based on that you can get the max rowno() and in the expression if you write RowID-10 then you will get the last 10 records.
Thanks,
Srini.
HI Kabilan,
Try the attach method.
Deepak
Hi,
It is fine. But may be it will give a performance issue if I have a lot of txt file
each txt file have 1,00,000 of records.
But we want the 10 records only.
In your sample we have to load the all records and from that we have to take the 10 records.
So, Is possible to solve this another way?
Thanks in advance..
Regards,
Kabilan K.