2017.06.16 06:25 AM
2017.06.16 09:18 AM
Hello experts,I am trying to use asof join to join the stock return, sector return and market return.My table looks as follows:stock (TABLE):stock | datetime | stockReturn | sectorAAPL 2017.04.03T09:30:00.00 0.00151 TECsector_market (TABLE):sector | datetime | sectorReturn | marketReturnTEC 2017.04.03T09:30:00.00 0.00187 0.00142I use the following query to join the table.aj[`sector`datetime;s_s;sector_market] I would love to get back in the following format:stock | datetime | stockReturn | sector | sectorReturn | marketReturnLet's track the joined time and sector. The result shows that time is matched while sector is not matched!tmp:aj[`datetime`sector;stock;update TimeMarket:datetime, SectorMarket:sector from sector_market]It gives me the wrong answer, for example:stock | datetime | stockReturn | sector | sectorReturn | marketReturn | TimeMarket | SectorMarketAAPL 2017.04.03T09:30:00.00 0.00151 TEC 0.00187 0.00142 2017.04.03T09:30:00.00 FINand finally, if merged, it gives me the FIN as a wrong sector.Can anyone helps on the problem?Many thanks in advance!Best,Kelly
2017.06.16 10:05 AM
2017.06.16 11:33 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.