Map table to another

Hello all, wondering if someone can help me out.

I would like to map a table to another table and add some columns to it.  So for example lets say I have table1 with columns timesymprice and every time there is published data to it I want to add that data to table2 which has columns timesympricerectime.  Whats the best way to do this?  Do I edit .u.pub to check if t is table1?  Then do something like .u.pub[`table2;select time,sym,price,recttime:.z.t from t]? 

You can subscribe to the table by using .u.sub and .u.upd. 

You can subscribe partially on a symbol basis as well. Once subscribed, you can write a custom .u.upd function to perform a set of actions to the incoming updates. 

I have written a blog post about subscribing to a table in tickerplant. Hope that helps!

Thanks Himanshu, helpful

To: Roni Hoffman , personal-kdbplus@googlegroups.com

If you need two ‘tables’, I would experiment with one table? having all columns and a view that selects a subset of the table. The view and table will stay in sync and it would be easier to manage.


From: Roni Hoffman

Sent: Wednesday, May 20, 2015 11:22
To: personal-kdbplus@googlegroups.com
Reply To: personal-kdbplus@googlegroups.com
Subject: [personal kdb+] Re: Map table to another

Thanks Himanshu, helpful