I’m trying to work with vectors on tables/dictionaries and I have a problem.
First I crate simple dictionary with 2 keys:
q)dict: (AAPLL1;AAPLL2)!(2014.09.01 2014.09.02;2014.09.02 2014.09.03)
Next I can modify each element in vector using indexes:
q)dict[AAPLL1;0]: 2014.08.31
All work fine. But when I try to do this with tables a got error `rank:
When you index into a table you use the column name, but here you have the added complexity of the table being keyed. E.g. tableSymbol would give you the list of symbols (if the table was unkeyed first), but tableAAPL obviously is meaningless because AAPL isn’t a column, it’s a value within the column. So (0!table)`AAPL just gives you an empty list.
Your best bet is an update statement
q)update L1:enlist(2014.08.31 2014.09.02) from table where Symbol=`AAPL
You can maybe have a cleverer function there that would drop (_) the first element in the list and join on your desired date, depending on what your use case is.