Home › Forums › KX Academy › .Q.def[] › Reply To: .Q.def[]
-
Dictionaries require lists to be passed to either side of !. You can use enlist to make lists from atoms:
q)d:.Q.def[enlist[`num1]!enlist 5].Q.opt .z.x
q)d
num1| 5If you are using kdb 4.1 you can use the new dictionary syntax which does not need enlist
q)d:.Q.def[([num1:5])].Q.opt .z.x
q)d
num1| 5