Hi,
Table t:
c1 c2 c3
a 1
x
b 2
y
c 3
z
How to convert rows to a list like this:
L:((a;1;
x);(b;2;
y);(c;3;
z))
Thanks.
Hi,
Table t:
c1 c2 c3
a 1
x
b 2
y
c 3
z
How to convert rows to a list like this:
L:((a;1;
x);(b;2;
y);(c;3;
z))
Thanks.
Hi Roy,
“value each t” should work in that case.
Thanks
Allan
Hi Roy,
I think you’re looking for something along the lines of this?
q)t
c1 c2 c3
a 1 x
b 2 y
c 3 z
q)lists:{value t} each til count t
q)lists
a 1
x
b 2
y
c 3
z
Regards,
Matt
Hi Roy,
A simple way to do this is with flip and value:
q)t:(a:a
bc;b:1 2 3;c:
xy
z)
q)t
a b c
a 1 x
b 2 y
c 3 z
q)flip value flip t
a 1
x
b 2
y
c 3
z
So here, the first flip turns the table into a list of dictionaries, which can be valued to strip the keys, which is then flipped back to your preferred format.
Thanks,
Ryan
To convert simple table to list:
l:flip t cols t
t[;cols t]