From listbox+trampoline+Q4+EFZ7+Jr0QrLei4BGBePbeePIvIg+BqUXUH@jeeves.archives.listbox.com  Wed Jun 29 21:22:24 2011
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1MNvg017941
	for <shasha@mail.cims.nyu.edu>; Wed, 29 Jun 2011 21:22:23 -0400 (EDT)
Received: from b-lb-ob-sd.listbox.com (b-lb-ob-sd.listbox.com [64.74.157.83])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1MBUD009370
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:22:11 -0400 (EDT)
Received: from b-lb-ob-sd.listbox.com (localhost [127.0.0.1])
	by b-lb-ob-sd.listbox.com (Postfix) with ESMTP id 27DB4BC1
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:24:01 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=listbox.com; h=
	mime-version:date:message-id:subject:from:to:content-type
	:reply-to:list-id:list-help:list-unsubscribe:list-subscribe; s=
	launch; bh=Pnjbz6UqVtBX5EHGGz43LioAIRY=; b=WqXnYU/cjlgqmvkI9g9zZ
	Nad/0bjs6tZ3No9J6l1gwk0sncrNSXuiXIe6O185B803RAG0hDmiqeiBY1StyY2H
	w==
Received: from b-lb-ex-sd.listbox.com (b-lb-ex-sd.listbox.com [64.74.157.87])
	by b-lb-ob-sd.listbox.com (Postfix) with ESMTP id 2535BBC0
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:24:01 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by b-lb-ex-sd.listbox.com (Postfix) with ESMTP id 04D60553
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:24:00 -0400 (EDT)
Received: from a-lb-mx-sd.listbox.com (a-lb-mx-sd.listbox.com [64.74.157.95])
 by a-lb-arc-quonix.listbox.com (Postfix) with ESMTP id 7D1CB16671 for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29 Jun 2011 21:22:03
 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1]) by
 a-lb-mx-sd.listbox.com (Postfix) with ESMTP id 906E45F06 for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29 Jun 2011 21:24:17
 -0400 (EDT)
Received: from mail-pv0-f175.google.com (mail-pv0-f175.google.com
 [74.125.83.175]) by a-lb-mx-sd.listbox.com (Postfix) with ESMTP id 4BFA25F05
 for <k4@listbox.com>; Wed, 29 Jun 2011 21:24:15 -0400 (EDT)
Received: by pvf24 with SMTP id 24so1323081pvf.6 for <k4@listbox.com>; Wed,
 29 Jun 2011 18:22:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=FU+QPZjoyY0qcjLgcjhBQ48we5fITiIxZ+M5FEvtIuk=;
 b=nMHDiYVKb745O7FH/mMPtqMekMf3qAyJ4+U3En/KPNwaQzLfWWYaEpWrIhcYPN4Sd2
 y9U79n5eWp/sBdqBFqs6fWxabj/CeJMLdrIsOCjpFopDULnOsf605EFiavG2geb3jMFl
 al++gJ5BnVykL9ZG+DlaXPC0v9ISdmyY7ioRY=
MIME-Version: 1.0
Received: by 10.68.8.66 with SMTP id p2mr1836627pba.505.1309396920460; Wed,
 29 Jun 2011 18:22:00 -0700 (PDT)
Received: by 10.68.40.72 with HTTP; Wed, 29 Jun 2011 18:22:00 -0700 (PDT)
Date: Wed, 29 Jun 2011 21:22:00 -0400
Message-ID: <BANLkTim2hi10mL3NJuCkJDSq4K8j1-2qrw@mail.gmail.com>
Subject: [k4] Rotate table: make rows column and columns row
From: mayank maheshwari <mayankiit04@gmail.com>
To: "k4" <k4@listbox.com>
Content-Type: multipart/alternative; boundary=bcaec53ae8785064e704a6e3ba27
Reply-To: k4@listbox.com
List-ID: <k4@listbox.com>
X-Listbox-List-ID: 1080 <k4@listbox.com>
List-Software: listbox.com v2.0
List-Help: <http://www.listbox.com/subscription-help.html>
List-Unsubscribe: <mailto:unsubscribe-k4@listbox.com>,
 <https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20110629212204:AC10BD26-A2B7-11E0-8178-F6DE78F22F22>
List-Subscribe: <mailto:subscribe-k4@listbox.com>,
 <http://www.listbox.com/subscribe/?list_id=1080>
X-Listbox-Post-Id: 20110629212204:AC10BD26-A2B7-11E0-8178-F6DE78F22F22
X-Listbox-Original-Sender: mayank maheshwari <mayankiit04@gmail.com>
Errors-To:  listbox+trampoline+Q4+EFZ7+Jr0QrLei4BGBePbeePIvIg+BqUXUH@jeeves.archives.listbox.com
X-Scanned-By: MIMEDefang 2.71 on 128.122.49.96
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Wed, 29 Jun 2011 21:22:23 -0400 (EDT)
Status: R
Content-Length: 289


--bcaec53ae8785064e704a6e3ba27
Content-Type: text/plain; charset=ISO-8859-1

Hi

Say we have a table where we have grouped it by a "by", ex names grouped by
cities.

Now is there a faster way of making those rows of cities as column?
one way is aj or join multiple tables.

Best,
Mayank


From listbox+trampoline+Q4+EFZ7+1u9RJbui4BGSW9x-pZOn6A+BqUXUH@jeeves.archives.listbox.com  Wed Jun 29 21:49:30 2011
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1nUTU022216
	for <shasha@mail.cims.nyu.edu>; Wed, 29 Jun 2011 21:49:30 -0400 (EDT)
Received: from b-lb-ob-sd.listbox.com (b-lb-ob-sd.listbox.com [64.74.157.83])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1nHMt017178
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:49:17 -0400 (EDT)
Received: from b-lb-ob-sd.listbox.com (localhost [127.0.0.1])
	by b-lb-ob-sd.listbox.com (Postfix) with ESMTP id C821D4D8
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:51:07 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=listbox.com; h=
	mime-version:in-reply-to:references:date:message-id:subject:from
	:to:content-type:reply-to:list-id:list-help:list-unsubscribe
	:list-subscribe; s=launch; bh=El5U6Mp2htcC+jPJa5s+CWwHlJk=; b=PQ
	/jL3xUMinhrSGlR/HbIG5OYPODcDAjb17W10EassjZFjnbnq/Xxz+bUWCmYTvua4
	juI+u30mUNjGGZoNFjqw==
Received: from b-lb-ex-sd.listbox.com (b-lb-ex-sd.listbox.com [64.74.157.87])
	by b-lb-ob-sd.listbox.com (Postfix) with ESMTP id C518E4D7
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:51:07 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by b-lb-ex-sd.listbox.com (Postfix) with ESMTP id B5CB8A3A
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:51:07 -0400 (EDT)
Received: from b-lb-mx-quonix.listbox.com (b-lb-mx-quonix.listbox.com
 [208.72.237.48]) by a-lb-arc-quonix.listbox.com (Postfix) with ESMTP id
 416E222527 for <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29
 Jun 2011 21:49:09 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1]) by
 b-lb-mx-quonix.listbox.com (Postfix) with ESMTP id 3FC323D18 for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29 Jun 2011 21:49:09
 -0400 (EDT)
Received: from mail-ew0-f47.google.com (mail-ew0-f47.google.com
 [209.85.215.47]) by b-lb-mx-quonix.listbox.com (Postfix) with ESMTP id
 4F8863D16 for <k4@listbox.com>; Wed, 29 Jun 2011 21:49:07 -0400 (EDT)
Received: by ewy5 with SMTP id 5so640328ewy.6 for <k4@listbox.com>; Wed, 29
 Jun 2011 18:49:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :content-type; bh=orv6wYM3nISK+v1KPTwlH+Fm4Su3zI+ZgpSjyptezc8=;
 b=xLnz+BLOn+Mb6+yv61EFc/HruPZo5R80NKzI+oJn4OUMFLgSDLtI6vJelGK0XTxTY0
 01/W7z7xlTyJmdOOYUGrsik2hn7lBmVPT1NeWWNqt+UqZ8yNPFRTNNlquSV+AIFXV5/e
 6UI1/JSO7vKse7OdXeQHAuL7uXGYfFARTq+Vc=
MIME-Version: 1.0
Received: by 10.213.19.75 with SMTP id z11mr388402eba.112.1309398545812; Wed,
 29 Jun 2011 18:49:05 -0700 (PDT)
Received: by 10.213.19.133 with HTTP; Wed, 29 Jun 2011 18:49:05 -0700 (PDT)
In-Reply-To: <BANLkTim2hi10mL3NJuCkJDSq4K8j1-2qrw@mail.gmail.com>
References: <BANLkTim2hi10mL3NJuCkJDSq4K8j1-2qrw@mail.gmail.com>
Date: Wed, 29 Jun 2011 21:49:05 -0400
Message-ID: <BANLkTimQ9Kon_u8CmCfso6jfdwHy1KK_rg@mail.gmail.com>
Subject: Re: [k4] Rotate table: make rows column and columns row
From: Fintan Quill <fintanq@gmail.com>
To: "k4" <k4@listbox.com>
Content-Type: multipart/alternative; boundary=001517492110314e0804a6e41bde
Reply-To: k4@listbox.com
List-ID: <k4@listbox.com>
X-Listbox-List-ID: 1080 <k4@listbox.com>
List-Software: listbox.com v2.0
List-Help: <http://www.listbox.com/subscription-help.html>
List-Unsubscribe: <mailto:unsubscribe-k4@listbox.com>,
 <https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20110629214910:2551EFD6-A2BB-11E0-925B-DC7EA593A7E8>
List-Subscribe: <mailto:subscribe-k4@listbox.com>,
 <http://www.listbox.com/subscribe/?list_id=1080>
X-Listbox-Post-Id: 20110629214910:2551EFD6-A2BB-11E0-925B-DC7EA593A7E8
X-Listbox-Original-Sender: Fintan Quill <fintanq@gmail.com>
Errors-To:  listbox+trampoline+Q4+EFZ7+1u9RJbui4BGSW9x-pZOn6A+BqUXUH@jeeves.archives.listbox.com
X-Scanned-By: MIMEDefang 2.71 on 128.122.49.96
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Wed, 29 Jun 2011 21:49:29 -0400 (EDT)
Content-Length: 3295


--001517492110314e0804a6e41bde
Content-Type: text/plain; charset=ISO-8859-1

Hello,

Do you mean a pivot?

https://code.kx.com/trac/wiki/pivot

Regards,

Fintan.

On Wed, Jun 29, 2011 at 9:22 PM, mayank maheshwari <mayankiit04@gmail.com>wrote:

> Hi
>
> Say we have a table where we have grouped it by a "by", ex names grouped by
> cities.
>
> Now is there a faster way of making those rows of cities as column?
> one way is aj or join multiple tables.
>
> Best,
> Mayank
>    *k4* | Unsubscribe Now<https://www.listbox.com/unsubscribe/?&&post_id=20110629212204:AC10BD26-A2B7-11E0-8178-F6DE78F22F22>
>



-------------------------------------------
k4
Unsubscribe Now: https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20110629214910:2551EFD6-A2BB-11E0-925B-DC7EA593A7E8

--001517492110314e0804a6e41bde
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div><br></div><div>Do you mean a pivot?</div><div><br></div><div><a =
href=3D"https://code.kx.com/trac/wiki/pivot">https://code.kx.com/trac/wiki/=
pivot</a></div><div><br></div><div>Regards,</div><div><br></div><div>Fintan=
.<br>
<br><div class=3D"gmail_quote">On Wed, Jun 29, 2011 at 9:22 PM, mayank mahe=
shwari <span dir=3D"ltr">&lt;<a href=3D"mailto:mayankiit04@gmail.com">mayan=
kiit04@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi=A0<div><br></div><div>Say we have a table where we have grouped it by a =
&quot;by&quot;, ex names grouped by cities.</div><div><br></div><div>Now is=
 there a faster way of making those rows of cities as column?</div><div>one=
 way is aj or join multiple tables.</div>

<div><br></div><div>Best,</div><div>Mayank</div>
<div style=3D"width:auto;margin:0;padding:5px;background-color:#fff;clear:b=
oth;border-top:1px solid #ccc" bgcolor=3D"#ffffff">

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%" styl=
e=3D"background-color:#fff" bgcolor=3D"#ffffff">
  <tbody><tr>
    <td>
      <font color=3D"#333333" size=3D"1" style=3D"font-family:helvetica, sa=
ns-serif">
      <strong>k4</strong> | <a style=3D"text-decoration:none;color:#669933;=
border-bottom:1px solid #444444" href=3D"https://www.listbox.com/unsubscrib=
e/?&amp;&amp;post_id=3D20110629212204:AC10BD26-A2B7-11E0-8178-F6DE78F22F22"=
 title=3D"" target=3D"_blank">Unsubscribe Now</a>

      </font>
    </td>
  </tr>
</tbody></table>
</div>
</blockquote></div><br></div>
<div style=3D"width:auto;margin:0;padding:5px;background-color:#fff;clear:b=
oth;border-top: 1px solid #ccc;" bgcolor=3D"#ffffff">

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%" styl=
e=3D"background-color:#fff" bgcolor=3D"#ffffff">
  <tr>
    <td padding=3D"4px">
      <font color=3D"#333333" size=3D"1" style=3D"font-family:helvetica, sa=
ns-serif;">
      <strong>k4</strong> | <a style=3D"text-decoration:none;color:#669933;=
border-bottom: 1px solid #444444"
href=3D"https://www.listbox.com/unsubscribe/?member_id=3D901033&id_secret=
=3D901033-6a517507&post_id=3D20110629214910:2551EFD6-A2BB-11E0-925B-DC7EA59=
3A7E8" title=3D"">Unsubscribe Now</a>

      </font>
    </td>
  </tr>
</table>
</div>

--001517492110314e0804a6e41bde--

From listbox+trampoline+Q4+EFZ7+PD1kpLyi4BG7YredZCSBrA+BqUXUH@jeeves.archives.listbox.com  Wed Jun 29 21:57:49 2011
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.49.96])
	by mail.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1vndZ023184
	for <shasha@mail.cims.nyu.edu>; Wed, 29 Jun 2011 21:57:49 -0400 (EDT)
Received: from b-lb-ob-quonix.listbox.com (b-lb-ob-quonix.listbox.com [208.72.237.5])
	by mx2.cims.nyu.edu (8.14.4+Sun/8.14.4) with ESMTP id p5U1vkUT019683
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:57:46 -0400 (EDT)
Received: from a-lb-ex-quonix.listbox.com (a-lb-ex-quonix.listbox.com [208.72.237.38])
	by b-lb-ob-quonix.listbox.com (Postfix) with ESMTP id 7D38315E
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:57:46 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by a-lb-ex-quonix.listbox.com (Postfix) with ESMTP id 795DCC0
	for <shasha@cs.nyu.edu>; Wed, 29 Jun 2011 21:57:46 -0400 (EDT)
Received: from a-lb-mx-sd.listbox.com (a-lb-mx-sd.listbox.com [64.74.157.95])
 by a-lb-arc-quonix.listbox.com (Postfix) with ESMTP id 316FF1686C for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29 Jun 2011 21:57:38
 -0400 (EDT)
Received: from localhost.localdomain (localhost [127.0.0.1]) by
 a-lb-mx-sd.listbox.com (Postfix) with ESMTP id 212575FC1 for
 <k4@listbox.com.email.enqueue.archive.listbox.com>; Wed, 29 Jun 2011 21:59:52
 -0400 (EDT)
Received: from mail-qw0-f47.google.com (mail-qw0-f47.google.com
 [209.85.216.47]) by a-lb-mx-sd.listbox.com (Postfix) with ESMTP id 0F3B75FC0
 for <k4@listbox.com>; Wed, 29 Jun 2011 21:59:50 -0400 (EDT)
Received: by qwh5 with SMTP id 5so987669qwh.6 for <k4@listbox.com>; Wed, 29
 Jun 2011 18:57:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :content-type; bh=JwBghL8aG2PiraPgxuPqk3NWAuPlfMyla5YY2hkvHw8=;
 b=AkshSwCV5J1RjMFw8Fb62kWjq2ILmJJ3x6djZNrF/R6Da4bv1N7iRTpYETKXnRMASU
 tehHV4P52eqil52yUlE9Z0R5cFhaOeLcX73W7lPLHt+qxtHI+hCdsatbe27IT8u7t7Ae
 WF95ywMw1X3JYAUROl0kiRNbi375rhMAFaF6w=
Received: by 10.229.191.205 with SMTP id dn13mr1133306qcb.40.1309399055111;
 Wed, 29 Jun 2011 18:57:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.226.12 with HTTP; Wed, 29 Jun 2011 18:57:14 -0700 (PDT)
In-Reply-To: <BANLkTimQ9Kon_u8CmCfso6jfdwHy1KK_rg@mail.gmail.com>
References: <BANLkTim2hi10mL3NJuCkJDSq4K8j1-2qrw@mail.gmail.com>
 <BANLkTimQ9Kon_u8CmCfso6jfdwHy1KK_rg@mail.gmail.com>
From: Patryk Bukowinski <p.bukowinski@gmail.com>
Date: Thu, 30 Jun 2011 03:57:14 +0200
Message-ID: <BANLkTimS6aL9gK_un_HdWndFfdZDEPvhTg@mail.gmail.com>
Subject: Re: [k4] Rotate table: make rows column and columns row
To: "k4" <k4@listbox.com>
Content-Type: multipart/alternative; boundary=90e6ba5bbc6d8c945704a6e439d3
Reply-To: k4@listbox.com
List-ID: <k4@listbox.com>
X-Listbox-List-ID: 1080 <k4@listbox.com>
List-Software: listbox.com v2.0
List-Help: <http://www.listbox.com/subscription-help.html>
List-Unsubscribe: <mailto:unsubscribe-k4@listbox.com>,
 <https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20110629215739:A4643D3C-A2BC-11E0-BB62-B79D642481AC>
List-Subscribe: <mailto:subscribe-k4@listbox.com>,
 <http://www.listbox.com/subscribe/?list_id=1080>
X-Listbox-Post-Id: 20110629215739:A4643D3C-A2BC-11E0-BB62-B79D642481AC
X-Listbox-Original-Sender: Patryk Bukowinski <p.bukowinski@gmail.com>
Errors-To:  listbox+trampoline+Q4+EFZ7+PD1kpLyi4BG7YredZCSBrA+BqUXUH@jeeves.archives.listbox.com
X-Scanned-By: MIMEDefang 2.71 on 128.122.49.96
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (mx2.cims.nyu.edu [128.122.49.96]); Wed, 29 Jun 2011 21:57:49 -0400 (EDT)
Content-Length: 6601


--90e6ba5bbc6d8c945704a6e439d3
Content-Type: text/plain; charset=ISO-8859-1

Using Fintan link to pivot and your example,
you would have something like this:

*q)t:([] city:`LDN`NY`WRO`LDN`WRO; names:`rooney`ali`dutkw`holmes`lenard)*
*q)t*
*city names*
*-----------*
*LDN  rooney*
*NY   ali*
*WRO  dutkw*
*LDN  holmes*
*WRO  lenard*

*q)P:asc exec distinct city from t*
*q)P*
*`s#`LDN`NY`WRO*

that's how the 'manual says',
now there is small modification to achieve pivot result:

*q)exec P#(c!names) by c:c from select names by c:city from t*
*c  | LDN            NY         WRO*
*---| ---------------------------------------*
*LDN| `rooney`holmes `symbol$() `symbol$()*
*NY | `symbol$()     ,`ali      `symbol$()*
*WRO| `symbol$()     `symbol$() `dutkw`lenard*

Regards,
Patryk






2011/6/30 Fintan Quill <fintanq@gmail.com>

> Hello,
>
> Do you mean a pivot?
>
> https://code.kx.com/trac/wiki/pivot
>
> Regards,
>
> Fintan.
>
>
> On Wed, Jun 29, 2011 at 9:22 PM, mayank maheshwari <mayankiit04@gmail.com>wrote:
>
>> Hi
>>
>> Say we have a table where we have grouped it by a "by", ex names grouped
>> by cities.
>>
>> Now is there a faster way of making those rows of cities as column?
>> one way is aj or join multiple tables.
>>
>> Best,
>> Mayank
>>    *k4* | Unsubscribe Now<https://www.listbox.com/unsubscribe/?&&post_id=20110629212204:AC10BD26-A2B7-11E0-8178-F6DE78F22F22>
>>
>
>    *k4* | Unsubscribe Now<https://www.listbox.com/unsubscribe/?&&post_id=20110629214910:2551EFD6-A2BB-11E0-925B-DC7EA593A7E8>
>



-------------------------------------------
k4
Unsubscribe Now: https://www.listbox.com/unsubscribe/?member_id=901033&id_secret=901033-6a517507&post_id=20110629215739:A4643D3C-A2BC-11E0-BB62-B79D642481AC

--90e6ba5bbc6d8c945704a6e439d3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Using Fintan link to pivot and your example,<br>you would have something li=
ke this:<br><br><div style=3D"margin-left: 40px;"><i>q)t:([] city:`LDN`NY`W=
RO`LDN`WRO; names:`rooney`ali`dutkw`holmes`lenard)</i><br><i>q)t</i><br><i>=
city names</i><br>

<i>-----------</i><br><i>LDN=A0 rooney</i><br><i>NY=A0=A0 ali</i><br><i>WRO=
=A0 dutkw</i><br><i>LDN=A0 holmes</i><br><i>WRO=A0 lenard</i><br><br><i>q)P=
:asc exec distinct city from t</i><br><i>q)P</i><br><i>`s#`LDN`NY`WRO</i><b=
r></div>

<br>that&#39;s how the &#39;manual says&#39;,<br>now there is small modific=
ation to achieve pivot result:<br><br><div style=3D"margin-left: 40px;"><i>=
q)exec P#(c!names) by c:c from select names by c:city from t</i><br><i>c=A0=
 | LDN=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 NY=A0=A0=A0=A0=A0=A0=A0=A0 WRO</i><=
br>

<i>---| ---------------------------------------</i><br><i>LDN| `rooney`holm=
es `symbol$() `symbol$()</i><br><i>NY | `symbol$()=A0=A0=A0=A0 ,`ali=A0=A0=
=A0=A0=A0 `symbol$()</i><br><i>WRO| `symbol$()=A0=A0=A0=A0 `symbol$() `dutk=
w`lenard</i><br></div>
<br>
Regards,<br>Patryk<br><br><br><br><br><br><br><div class=3D"gmail_quote">20=
11/6/30 Fintan Quill <span dir=3D"ltr">&lt;<a href=3D"mailto:fintanq@gmail.=
com">fintanq@gmail.com</a>&gt;</span><br><blockquote class=3D"gmail_quote" =
style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 20=
4); padding-left: 1ex;">

Hello,<div><br></div><div>Do you mean a pivot?</div><div><br></div><div><a =
href=3D"https://code.kx.com/trac/wiki/pivot" target=3D"_blank">https://code=
.kx.com/trac/wiki/pivot</a></div><div><br></div><div>Regards,</div><div><br>

</div><div>Fintan.<div><div></div><div class=3D"h5"><br>
<br><div class=3D"gmail_quote">On Wed, Jun 29, 2011 at 9:22 PM, mayank mahe=
shwari <span dir=3D"ltr">&lt;<a href=3D"mailto:mayankiit04@gmail.com" targe=
t=3D"_blank">mayankiit04@gmail.com</a>&gt;</span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px sol=
id rgb(204, 204, 204); padding-left: 1ex;">


Hi=A0<div><br></div><div>Say we have a table where we have grouped it by a =
&quot;by&quot;, ex names grouped by cities.</div><div><br></div><div>Now is=
 there a faster way of making those rows of cities as column?</div><div>

one way is aj or join multiple tables.</div>

<div><br></div><div>Best,</div><div>Mayank</div>
<div style=3D"width: auto; margin: 0pt; padding: 5px; background-color: rgb=
(255, 255, 255); clear: both; border-top: 1px solid rgb(204, 204, 204);" bg=
color=3D"#ffffff">

<table style=3D"background-color: rgb(255, 255, 255);" bgcolor=3D"#ffffff" =
border=3D"0" cellpadding=3D"0" cellspacing=3D"0" width=3D"100%">
  <tbody><tr>
    <td>
      <font style=3D"font-family: helvetica,sans-serif;" color=3D"#333333" =
size=3D"1">
      <b>k4</b> | <a style=3D"text-decoration: none; color: rgb(102, 153, 5=
1); border-bottom: 1px solid rgb(68, 68, 68);" href=3D"https://www.listbox.=
com/unsubscribe/?&amp;&amp;post_id=3D20110629212204:AC10BD26-A2B7-11E0-8178=
-F6DE78F22F22" title=3D"" target=3D"_blank">Unsubscribe Now</a>

      </font>
    </td>
  </tr>
</tbody></table>
</div>
</blockquote></div><br></div></div></div>
<div style=3D"width: auto; margin: 0pt; padding: 5px; background-color: rgb=
(255, 255, 255); clear: both; border-top: 1px solid rgb(204, 204, 204);" bg=
color=3D"#ffffff">

<table style=3D"background-color: rgb(255, 255, 255);" bgcolor=3D"#ffffff" =
border=3D"0" cellpadding=3D"0" cellspacing=3D"0" width=3D"100%">
  <tbody><tr>
    <td>
      <font style=3D"font-family: helvetica,sans-serif;" color=3D"#333333" =
size=3D"1">
      <b>k4</b> | <a style=3D"text-decoration: none; color: rgb(102, 153, 5=
1); border-bottom: 1px solid rgb(68, 68, 68);" href=3D"https://www.listbox.=
com/unsubscribe/?&amp;&amp;post_id=3D20110629214910:2551EFD6-A2BB-11E0-925B=
-DC7EA593A7E8" title=3D"" target=3D"_blank">Unsubscribe Now</a>

      </font>
    </td>
  </tr>
</tbody></table>
</div>
</blockquote></div><br>
<div style=3D"width:auto;margin:0;padding:5px;background-color:#fff;clear:b=
oth;border-top: 1px solid #ccc;" bgcolor=3D"#ffffff">

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%" styl=
e=3D"background-color:#fff" bgcolor=3D"#ffffff">
  <tr>
    <td padding=3D"4px">
      <font color=3D"#333333" size=3D"1" style=3D"font-family:helvetica, sa=
ns-serif;">
      <strong>k4</strong> | <a style=3D"text-decoration:none;color:#669933;=
border-bottom: 1px solid #444444"
href=3D"https://www.listbox.com/unsubscribe/?member_id=3D901033&id_secret=
=3D901033-6a517507&post_id=3D20110629215739:A4643D3C-A2BC-11E0-BB62-B79D642=
481AC" title=3D"">Unsubscribe Now</a>

      </font>
    </td>
  </tr>
</table>
</div>

--90e6ba5bbc6d8c945704a6e439d3--

