I have a table T with column Sym:`IBM`MSFT`GOOG...
Want the easiest way to create new column of the form newColumn: "IBM_Buy","MSFT_Buy","GOOG_Buy",...
The following does NOT seem to do the trick:
select ((string Sym),"_Buy") from T
You need to use each-left (\:). Think of it as concatenating "_Buy" to each item on a list.
select (string[Sym],\:"_Buy") from T
You may use each-both (')
function with anonymous function in select statement:
select {x, "_Buy"}'[Sym] from T
t:([]sym:`IBM`MSFT`GOOG)
update newsym:(string sym) cross enlist "_Buy" from t
or easy way (Dictionary Format)
t[`newsym] :
(string t[`sym]) cross enlist "_Buy"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With