cancel
Showing results for 
Search instead for 
Did you mean: 

pivot table

User
Not applicable
I dont get how k:k generates a dictionary on the page here http://code.kx.com/wiki/Pivot
2 REPLIES 2

FutureInSound
New Contributor
It doesn't create a dictionary, it only gives a name to the keyed column so that you get

q)exec P#(p!v) by k:k from t
k
| xx yy zz
-| --------
1| 10
2| 40 20
3|    50 30


Instead of

q)exec P#(p!v) by k from t
 
| xx yy zz
-| --------
1| 10
2| 40 20
3|    50 30

Zak

Rolf
New Contributor III
alternate syntax

q)exec P#p!v by([]k)from t
k| xx yy zz
-| --------
1| 10
2| 40 20
3| 50 30