Let's say I have the following,
q)add2:{[x]:x+2};
q)Bidcols:`Bid1px`Bid2px`Bid3px;
q)table:([]time:9 11;Bid1px:4 5;Bid2px:7 3;Bid3px:6 8);
time Bid1px Bid2px Bid3px
-------------------------
9 4 7 6
11 5 3 8
and I want to apply this add2 function to each cols of the table like the below
q)table:update Bid1px:add2'[Bid1px],Bid2px:add2'[Bid2px],Bid3px:add2'[Bid3px] from table;
time Bid1px Bid2px Bid3px
-------------------------
9 6 9 8
11 7 5 10
My questions are:
- Is there a way to do this using Bidcols?
- What are the other efficient ways to achieve this?
Thanks in advance.