cancel
Showing results for 
Search instead for 
Did you mean: 

Q for examples - Simple Structural transforms

eletrofone
New Contributor
Good Morning!
Due to a lot of work at the beginning of the year, I had to slow down the study pace.

I am currently at:
https://code.kx.com/q/learn/q-by-examples/

Topic: Structural transforms

I was able to understand all the examples, except:
q) 0 3 _ /: 2 6 # til 12
0 1 2     3 4 5
6 7     8     9 10 11

I understand the function of each one separated: _   /:   #   and   til
But together, I expected another result.

I thank you for your help.
3 REPLIES 3

eletrofone
New Contributor
Guys, I actually got it.
But my doubt is because the number 8 is displayed separately from the others.

q) show N: 0 3 _ /: 2 6 # til 12
0 1 2    3 4 5
6 7    8    9 10 11

Observe the result of this command:
q) (N 1) 0
6 7 8

This is how I expected the result:
0 1 2     3 4 5
6 7 8     9 10 11

(Just a visual detail)

Thanks again to all!

Em domingo, 7 de fevereiro de 2021 às 08:05:31 UTC-3, Geraldo M Melo Jr escreveu:
Good Morning!
Due to a lot of work at the beginning of the year, I had to slow down the study pace.

I am currently at:

Topic: Structural transforms

I was able to understand all the examples, except:
q) 0 3 _ /: 2 6 # til 12
0 1 2     3 4 5
6 7     8     9 10 11

I understand the function of each one separated: _   /:   #   and   til
But together, I expected another result.

I thank you for your help.

konq
New Contributor II
q)a:0 3 _/: 2 6 # til 12
8 is shifted by a space to be aligned with 11
q)a 1
6 7  8
9 10 11
  Konstantin


Boa tarde!
Muito obrigado pela ajuda e atenção.

Em dom, 7 de fev de 2021 12:14, Konstantin Orman <konstantin.orman@gmail.com> escreveu:
q)a:0 3 _/: 2 6 # til 12
8 is shifted by a space to be aligned with 11
q)a 1
6 7  8
9 10 11
  Konstantin