1

I am trying out the example on how to join two tables found at http://code.kx.com/q/ref/lists/#join

The example shows:

 t:([]a:1 2 3;b:`a`b`c)
 r:([]c:10 20 30;d:1.2 3.4 5.6)
 show t,`r

with this as the result:

     a b c  d
     ----------
     1 a 10 1.2
     2 b 20 3.4
     3 c 30 5.6

However, when I try it in my q console, I am getting this result:

   q)t,`r
   `a`b!(1;`a)
   `a`b!(2;`b)
   `a`b!(3;`c)
   `r

Can someone please explain what is happening, and what I am doing wrong?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Hopper06
  • 89
  • 2
  • 10

1 Answers1

3

It's a tick ('), not a backtick (`)

So it should be

t,'r

not

t,`r
terrylynch
  • 11,844
  • 13
  • 21
  • To elaborate further, you were appending the symbol `r to a table (list of dictionaries) which resulted in a general/mixed/non-uniform list. Same would occur if you tried t,2 for example. – terrylynch Oct 06 '14 at 14:46
  • Ah, such an easy mistake to make. I am so used to using the backtick, I didn't even consider it might not be used in this case. Thank you very much! – Hopper06 Oct 06 '14 at 17:52