2

I can create the following table in kdb using

([]idx:0,1,2;str:"a","b","c")

idx str
0   a
1   b
2   c

but I cant do for instance

([]idx:0,1,2;str:"aa","bb","cc")

I would like to get

idx str
0   aa
1   bb
2   cc

What am I doing wrong when creating this string column?

1 Answer 1

3

Use braces and semi-colons rather than commas to separate list items:

q)([]idx:(0;1;2);str:("aa";"bb";"cc"))
idx str
--------
0   "aa"
1   "bb"
2   "cc"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.