Reorder Elements

Question: The function 'xcols' reorders the columns of a table by reordering the column list and selecting those columns. Define a function 'reorder' that takes in an atom/list 'x' and a list 'y', and reorders 'y' by 'x'.

Example

                                
                                q)reorder[`s;`a`b`s]
`s`a`b
q)reorder[`s`b;`a`b`s]
`s`b`a
q)reorder[`f`b;`a`b`s]
`b`a`s
                                
                            

Solution

Tags:
functions
Searchable Tags
algorithms api csv dictionaries feedhandler finance functions ingestion ipc iterators math optimizations realtime sql streaming strings tables temporal websockets

Email sent!

Email not sent