Search code examples
kdb

How to join a list of tables in kdb


I'm using the below to join multiple tables

() uj/(a;b;c)

However is there a way to pass a list of tables to achieve this?

Currently if i do the below I get a type error

tbList:tables[]
() uj/(tbList)

Thank you


Solution

  • uj requires table arguments, while tables[] returns the names of variables in the root namespace which are tables as a list of symbols.

    To get a list of tables from this you can use value each tables[] which will evaluate each variable name in turn and will return the evaluated tables as a list.

    If / (over) is supplied with only a single list argument, it will take the first element to be the initial value so you don't need to supply an empty list as the initial value like so:

    uj/[value each tables[]]