KX Community

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

Home Forums kdb+ How can I apply a func to a grouped table? Reply To: How can I apply a func to a grouped table?

  • Cecilia

    Member
    July 27, 2024 at 3:50 am

    I ran into another problem. It seems some AskOrder of the stock has less than 16 data, so it says

    ‘length

    [1] f:{(`$x,/:string 1+til y)!az -1+(where deltas y xrank az:asc z),count z}

    What should I do?

    I’ve tried to filter out those stock using:

    select from t where count each AskOrder > 16 by stock

    However, it says

     'stock
    [3] select from t where count each AskOrder > 16 by stock

    My t is like this:

    q)t
    stock AskOrder BidOrder
    -----------------------
    p 1 39
    e 76 97
    k 65 74

    I’ve also tried to use length:

    l: select length: count each AskOrder by stock from t;
    l: () xkey lengths;
    select stock from l where length > 16;

    But it says:

    'type
    [3] select stock from l where length > 16;