I am trying to run an iterative union join on a table from within a tick function according to the kdb tick architecture as follows:
table1:([]time:`timespan$();sym:`symbol$();var1:`float$());
if[not system"t";system"t 1000";
.z.ts:{
table2: ...
table1:table1 uj table2 / throws non descriptive error
`table1 uj table2 / throws type error
}
non descriptive error:
'table1
[0] ()
I am trying to maintain a local table that keeps the last 500 or so rows (with dynamic columns) in order to run further processing. However I can't seem to update the table from within the tick function. How should one implement this functionality? Thanks
You are getting 'table1 as an error as it is not defined locally within .z.ts
. In kdb if there is local assignment to a specific variable within a function, kdb references that variable locally within the function. In the example of table1
you assign it locally within .z.ts
but then attempt to reference table1
which you assigned globally outside of .z.ts
. To fix your issue you must assign table1
globally within .z.ts
like so table1::table1 uj table2
.
table1:([]time:`timespan$();sym:`symbol$();var1:`float$());
if[not system"t";system"t 1000";
.z.ts:{
table2: ...
table1::table1 uj table2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With