q)t:([] head:enlist 1)
q)t
head
----
1
q)first exec head from t
1
q) // or the shortest way
q)t[`head]0
1
q)type first exec head from t
-7h
q)100*first exec head from t
100
q)first t`head
1
q)raze/[t]0
1
Question
How do I convert a table to an atom? I have a 1x1 table with a header. I want to get rid of the header and just have the number so that I do things like anotherTable*thisNumber and so on.
I've tried:
(raze raze tableName)
but this gives me: enlist 10.5, how do I get 10.5 (as a number)?
Solution
OTHER TIPS
Think you can use over
and indexing to do this:
q)raze/[([]a:1#1)]0
1
For Ryan example:
t:([] head:enlist 1)
We can also simply do,
first t`head
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow