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 architecture asynchronous c csv data structures dictionaries disk feedhandler finance functions ingestion ipc iterators machine learning math multithreading optimizations realtime shared library sql statistics streaming strings tables temporal utility websockets