cancel
Showing results for 
Search instead for 
Did you mean: 

Add a Linked Column with an enumeration other than sym

hoffmanroni
New Contributor III
Example, I have tables

companyInfo:([] exchange:`NYSE`NDQ`NYSE`TSE;sector:4?("Banking";"Retail";"Food Producers");MarketCap:30000000+4?1000000)
trades:([]sym:`a`b`c`a`b;ex:`NYSE`NDQ`LSE`NYSE`NDQ;price:5?100.);

How do enumerate the exchange column of companyInfo to a separate file then the sym enumeration?
Then I need to add the link column to the partition and update .d, correct?

Thanks!



1 REPLY 1

Flying
New Contributor III
q)companyInfo:([] exchange:`NYSE`NDQ`NYSE`TSE;sector:4?("Banking";"Retail";"Food Producers");MarketCap:30000000+4?1000000)
q)trades:([]sym:`a`b`c`a`b;ex:`NYSE`NDQ`LSE`NYSE`NDQ;price:5?100.);
q)`:companyInfo/ set update`:sym_ex?exchange from companyInfo
`:companyInfo/
q)`:trades/ set update`:sym?sym,`:sym_ex?ex from trades
`:trades/
q)\dir
" Volume in drive E has no label."
" Volume Serial Number is XXXX-XXXX"
""
" Directory of e:\\DEV\\db"
""
"2016.09.01  14:02    <DIR>          ."
"2016.09.01  14:02    <DIR>          .."
"2016.09.01  14:04    <DIR>          companyInfo"
"2016.09.01  14:02                14 sym"
"2016.09.01  14:04                25 sym_ex"
"2016.09.01  14:04    <DIR>          trades"
"               2 File(s)             60 bytes"
"               4 Dir(s)  68,000,000,000 bytes free"
q)\l .
q)meta companyInfo
c        | t f a
---------| -----
exchange | s
sector   | C
MarketCap| j
q)meta trades
c    | t f a
-----| -----
sym  | s
ex   | s
price| f
q)type each flip companyInfo
exchange | 21
sector   | 87
MarketCap| 7
q)type each flip trades
sym  | 20
ex   | 21
price| 9