Home › Forums › kdb+ › select with ssr function › Reply To: select with ssr function
-
https://code.kx.com/q/ref/each/
Use each:
q)select {[x]ssr[x;".C";""]} each orderID, cancelTime from t
https://code.kx.com/q/basics/application/#projection
Neater with projection:
select ssr[;".C";""] each orderID, cancelTime from t
https://code.kx.com/q/ref/drop/
If you know .C is always at the end it’s much better to use drop _ rather than ssr as ssr is compute intensive
select {-2_ x} each orderID, cancelTime from t
https://code.kx.com/q/ref/maps/#each-left-and-each-right
each-right /: is neater
q)select -2_/:orderID, cancelTime from t