Fomalhaut -C
Fomalhaut -C

Reputation: 320

How to pass arguments to a function (Q/KDB+)?

Say I have a function:

quotes:{[ticker;x;y]
output: ....
}

How can I use this function iterate over a list in another function:

combiner:{[tickerList;x;y]
output: uj quotes[ticker1;x;y], quotes[ticker2;x;y], etc.
}

Upvotes: 1

Views: 1247

Answers (1)

Thomas Smyth
Thomas Smyth

Reputation: 5644

You can combine uj with over / to do this:

uj/[list of tables]

In you case this may look like:

uj/[quotes[;x;y]each tickerList]

If the quotes function always outputs tables with the same schema you can use raze instead:

raze quotes[;x;y]each tickerList

raze and uj are both join functions and an implementation of , but raze requires the schema of all tables to be the same.

Upvotes: 1

Related Questions