dla
(David Laosa)
September 14, 2022, 4:11pm
1
Hello,
I’ve got a DT from an Excel using “read range” activity. Then I sorted (descending) the DT using “Sort DataTable” activity, and getting a new DT (orderedDT).
And now my question:
Is there any way to obtain only the top ten rows from orderedDT?
Thank you in advance,
David Laosa
muthuraj.c
(Muthuraj)
September 14, 2022, 4:15pm
2
Hi,
Try this:
DT_Input.AsEnumerable().Take(10).CopyToDataTable
Thanks,
Muthuraj
Hi @dla ,
Dt2 = Dt1.Clone Dt2=Dt1.AsEnumerable().Take(50).CopyToDataTable()
So First make clone of DT1 to get headers. Then run query.
Thanks
dla
(David Laosa)
September 14, 2022, 4:49pm
5
Thank you so much.
It’s also a good solution, but I didn’t need headers this time.
Thanks again
@dla welcome, but you did not mention in your statement. So I gave you generic one
1 Like
system
(system)
Closed
September 17, 2022, 4:52pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.