Search code examples
kdb

How to get index of elements in a nested list kdb


Lets say I have a nested list: (`a`b`c;`d`e`f;`g`h`i) I have another list of indexes i:(1 0 3)

How do I use the list of indexes, to retrieve symbols from the list. The desired output should be (`b`d`) (the last symbol is null)

Thanks!


Solution

  • You will need to use the apply operator @ with the each-both iterator ':

    q)list @' i
    `b`d`