# enumeration

**URL:** <https://forum.kx.com/t/enumeration/7294>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [September 20, 2011, 6:12pm UTC](https://forum.kx.com/t/enumeration/7294 "2011-09-20T18:12:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbtouch](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@dbtouch](https://forum.kx.com/u/dbtouch)\
**Post date:** [September 20, 2011, 6:12pm UTC](https://forum.kx.com/t/enumeration/7294/1 "2011-09-20T18:12:00Z")

</div>

Hi, KDB Folks

Please help me understand enumeration from q function reference. What  
about `a? My understanding is that 1 2 3 is mapped `b`c`d? I tried:

q)`x!1 2 3 4 `x$`b`c`d`

I expected `x$`a`b`c`d (what about `a?) Could you explain it with a  
more straight forward example.

Again, thank you for your help.

========================================================  
enumeration

With a symbol on the left hand side, converts an integer list to an  
enumerated symbol list

q)x:`a`b`c`d  
q)`x!1 2 3 `x$`b`c`d

---

<div class="post-metadata">

**Author:** ![\_Oz](https://avatars.discourse-cdn.com/v4/letter/_/f07891/32.png) [@\_Oz](https://forum.kx.com/u/_Oz)\
**Post date:** [September 20, 2011, 6:27pm UTC](https://forum.kx.com/t/enumeration/7294/2 "2011-09-20T18:27:00Z")

</div>

Enumerations are 0-based (as well as indexes)

---

<div class="post-metadata">

**Author:** ![gpraghuram](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@gpraghuram](https://forum.kx.com/u/gpraghuram)\
**Post date:** [September 21, 2011, 5:46am UTC](https://forum.kx.com/t/enumeration/7294/3 "2011-09-21T05:46:00Z")

</div>

On Tue, Sep 20, 2011 at 10:42 PM, dbtouch \<dbtouch@gmail.com\> wrote:

> Hi, KDB Folks
> 
> Please help me understand enumeration from q function reference. What  
> about `a? My understanding is that 1 2 3 is mapped `b`c`d? I tried:
> 
> ?q)`x!1 2 3 4 `x$`b`c`d`
> 
> I expected `x$`a`b`c`d (what about `a?) Could you explain it with a  
> more straight forward example.
> 
> Again, thank you for your help.
> 
> ========================================================  
> enumeration
> 
> With a symbol on the left hand side, converts an integer list to an  
> enumerated symbol list
> 
> q)x:`a`b`c`d  
> q)`x!1 2 3 `x$`b`c`d  
>   
> –
> 
> Submitted via Google Groups

---

<div class="post-metadata">

**Author:** ![dbtouch](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@dbtouch](https://forum.kx.com/u/dbtouch)\
**Post date:** [September 21, 2011, 2:51pm UTC](https://forum.kx.com/t/enumeration/7294/4 "2011-09-21T14:51:00Z")

</div>

Thanks a lot, Raghu and Oleg.On Sep 21, 12:46?am, raghuram p \<gpraghu…\> wrote:\> On Tue, Sep 20, 2011 at 10:42 PM, dbtouch \<dbto…\> wrote:\> \> Hi, KDB Folks\>\> \> Please help me understand enumeration from q function reference. What\> \> about `a? My understanding is that 1 2 3 is mapped `b`c`d? I tried:\>\> \> ?q)`x!1 2 3 4&gt; &gt; `x$`b`c`d`\>\> \> I expected `x$`a`b`c`d (what about `a?) Could you explain it with a\> \> more straight forward example.\>\> \> Again, thank you for your help.\>\> \> ========================================================\> \> enumeration\>\> \> With a symbol on the left hand side, converts an integer list to an\> \> enumerated symbol list\>\> \> q)x:`a`b`c`d\> \> q)`x!1 2 3&gt; &gt; `x$`b`c`d\>\> \> –\> \>

Submitted via Google Groups\</dbto…\>\</gpraghu…\>
