KX Community

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

Home Forums kdb+ how to understand the code below Re: how to understand the code below

  • leahs

    Member
    April 15, 2022 at 12:00 am

    Hello @chan_chenyanj,

    At first glance, ‘1’ seems erroneous. I suspect a rank error when you run ‘1’ with root cause ‘iasc each col1’.

    The ‘iasc‘ keyword accepts a list or a dictionary and col here is a simple symbol list and so there would be no need for ‘each’. ‘iasc’ returns the indexes needed to sort the list in ascending order.

    Remove ‘each’ and step through to see the output.

    Before stepping through ‘2’, is your intention to query original t, or query an updated table that you could assign to ‘1’ (currently would suspect an error returned for both cases)

    I can run the code next week and explain the logic further. Fellow contributors may be able to share in the meantime.

    Happy Coding.