How to cut the biggest n item?

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?

You most likely want to use sublist 

http://code.kx.com/wiki/Reference/sublist

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