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
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
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"
You may use each-both (')
function with anonymous function in select statement:
select {x, "_Buy"}'[Sym] from T
© 2022 - 2024 — McMap. All rights reserved.