Reputation: 19486
I'm trying to create a new, empty, splayed table:
price_data: ([] s:`$(); t:`timestamp$(); o:`float$(); h:`float$(); l:`float$(); c:`float$(); v:`int$())
`:/home/data/price_data/ set price_data
I'm getting a type mismatch error. What am I doing wrong?
Upvotes: 0
Views: 784
Reputation: 1780
When setting splayed tables all symbol columns need to be enumerated, otherwise it will throw a type error.
This can be achieved using .Q.en, which converts the symbol columns to integral values and a corresponding sym file containing the symbol values.
Enumerated symbol columns have type 20h instead of type 11h.
/ pre enumeration
q)type price_data`s
11h
/ after enumeration
q)type .Q.en[`:.;price_data]`s
20h
/ since we have no symbols in our table an empty sym file is generated
q)get`:sym
`symbol$()
Upvotes: 2