Home › Forums › kdb+ › how to understand the code below › Re: how to understand the code below
-
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.