KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Accessing the last element of List of List Re: Accessing the last element of List of List

  • soheir

    Member
    December 8, 2021 at 12:00 am

    This might be what you’re looking for then

    q) x1:(`Col1;12;.z.Z) 
    q) x2:(`Col1;12;`ERROR) 
    q) show y:(x1;x1;x1;x2) 
    `Col1 12 2021.12.08T17:46:26.162 
    `Col1 12 2021.12.08T17:46:26.162 
    `Col1 12 2021.12.08T17:46:26.162 
    `Col1 12 `ERROR 
    q) {x,@[gtime;last x;0Np]}each y 
    `Col1 12 2021.12.08T17:46:26.162 2021.12.08T17:46:26.162 
    `Col1 12 2021.12.08T17:46:26.162 2021.12.08T17:46:26.162 
    `Col1 12 2021.12.08T17:46:26.162 2021.12.08T17:46:26.162 
    `Col1 12 `ERROR 0Np