2019.05.13 11:41 AM
2019.05.13 03:52 PM
2019.05.13 04:27 PM
2019.05.14 12:45 AM
I think there's two issues:
1. Use vector conditional (even if you only have a single boolean)2. The aggregation isn't being "recognised" so you have to manually enlist
/aggregation recognised - atom automatically enlistedq)select max qty from spqty---90
/aggregation not recognised - result isn't a listq)select {max x}qty from sp'rank [0] select {max x}qty from sp ^
/manually enlist to ensure list outputq)select {enlist max x}qty from spqty---90
Putting it all together
q)select ?[1b;{enlist max x};{enlist min x}]qty from spqty---90
q)select ?[0b;{enlist max x};{enlist min x}]qty from spqty---1
2019.05.14 12:50 AM
2019.05.14 12:53 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.