cancel
Showing results for 
Search instead for 
Did you mean: 

How to cut the biggest n item?

carfield1
New Contributor
HI all

Say I have a table with stock at column A and also list of 20 items at column B, I can use "cut 18 each B" to get the first 18th item of the list. However, not all stock have 20 item at the list. However can I cut the last 2 elements whatever the size of the list is?

3 REPLIES 3

TerryLynch
New Contributor II
You most likely want to use sublist 

sieber
New Contributor
Hi,

you want to remove the last 2 entries of each list?
use the function _, for example:   -2_1 2 3 4  returns 1 2...
-> http://code.kx.com/wiki/Reference/Underscore

Markus

Thanks, it is helpful