Home › Forums › kdb+ › Linked Columns and overloads of $ ! ? › Reply To: Linked Columns and overloads of $ ! ?
-
Q1. Yes,
$
is creating an enum. https://code.kx.com/q/ref/enumerate/ . Could you supply a reproducible case for what the variables represent in the first statement.Q2. KeyedTable (kt?) is documented see https://code.kx.com/q/kb/faq/#keyed-tables.
Q3.
?
is doing a find. https://code.kx.com/q/ref/find/>>>t1
c1 c2
—–
c 10
b 20
a 30
>>>c3
`sym$`a`b`a`c
>>>t1.c1?c3
2 1 2 0
Q4. The
!
is simply creating an enumeration. If you are then to update the table with the result of that query, it would be added to the table as a foreign key. Documentation exists here. https://code.kx.com/q/ref/enumeration/>>>`t1!t1.c1?c3
`t1!2 1 2 0
>>>update link:`t1!t1.c1?c3 from `t2
`t2
>>>meta t2
c | t f a
—-| ——
c3 | s
c4 | f
link| j t1
The following page has some examples on the different types of enum operations: https://code.kx.com/q/basics/enumerations/
code.kx.com
Enumerate | Reference | kdb+ and q documentation - kdb+ and q documentation
Enumerate is a q operator that returns one list as an enumeration of another.