I am having difficulty removing an entry from KDB dictionary. Keys and values are strings.
Working
q)l3:`a`b`c!1 2 3
q)`a _l3
b| 2
c| 3
Not working
q)l2:("k1";"k2";"ABC")!("v1";"v2";"BLA BLA")
q)"k1" _l2
'type
Thanks, Eugene
I think you should use enlist to drop the string key from dictionary:
q)enlist["k1"]_("k1";"k2";"ABC")!("v1";"v2";"BLA BLA")
"k2" | "v2"
"ABC"| "BLA BLA"
_(drop) takes left input as list of elements of the dictionary key (with exception when it comes to symbol key). Try to imagine that in your case, "k1" is an 'atom' and to create a singleton list, you can just enlist "k1".
Reference: http://code.kx.com/q/ref/lists/#_-cut
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With