cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
aaronjiang
Level I

Select first/second half of rows to form a subset

I have a question about how to select first half or second of rows to form a subset. I don't want to manually type in 1,2,3,4,5,...,10 (if there are 20 rows) because my rows could be different from time to time. I have a equation that define number of rows that will appear in the original table. Is there anything like select row (1:10) or others that make it easier?

1 REPLY 1
txnelson
Super User

Re: Select first/second half of rows to form a subset

You can use the following JSL

dt=current data table();
dt<<select where(Row()<=N Rows(dt)/2);

dt2=dt<<subset(selected rows(1), selected columns(0));
Jim