Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a huge login table, with all the login times of all users since ages.
How do I limit load to last, say, 10 logins per user so I can have a glimpse on their habits without the burden?
Something like:
LOAD Only(UserID),
FirstValues(LoginDate, 10)
GROUP BY UserID
ORDER BY LoginDate DESC;
I tried searching for an answer with no luck.
Thanks for your help
Thank you for your answer, I accepted Antonio's answer below as it does not leave an extra column in Login table.
Hello Tomasz,
this won't happen as soon as I declare Login: as a new table with it's own name, just tested I get the reults
hello Antonio,
I marked this as correct as a proof of concept.
In reality this keeps the first 2 logins while I asked for the last 2.
For this reason more work is expected instead of a simple "WHERE A>=2",
however you set me in the right direction, thank you.
Hi Renzo,
use above script with NoConcatenate and AutoNumber(RowNo(), UserID) <= 2
First or Last is depending on Desc or Asc in Order By clause.
Regards,
Antonio
Hello Antonio,
you are right, noconcatenate included.
I updated correct answer, thank you for your help
I'm glad to helped You.
Regards,
Antonio