# how to read this two symbols

**URL:** <https://forum.kx.com/t/how-to-read-this-two-symbols/13461>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [April 9, 2022, 12:00am UTC](https://forum.kx.com/t/how-to-read-this-two-symbols/13461 "2022-04-09T00:00:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chan\_chenyanj](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chan\_chenyanj](https://forum.kx.com/u/chan_chenyanj)\
**Post date:** [April 9, 2022, 12:00am UTC](https://forum.kx.com/t/how-to-read-this-two-symbols/13461/1 "2022-04-09T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/how-to-read-this-two-symbols](https://learninghub.kx.com/forums/topic/how-to-read-this-two-symbols)

suppose i have a table with filed1 is list of symbol `1m`3m and filed2 is source `bbg`bbg

&nbsp;

then how should i read

&nbsp;

```
1. #[;1b] each count each field2 from table

2. {x 1 0} each filed1 from table
```

---

<div class="post-metadata">

**Author:** ![lkerr2](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/lkerr2/32/57_2.png) [@lkerr2](https://forum.kx.com/u/lkerr2)\
**Post date:** [April 9, 2022, 12:00am UTC](https://forum.kx.com/t/how-to-read-this-two-symbols/13461/2 "2022-04-09T00:00:00Z")

</div>

1. `count each field2` implies each item of `field2` is a list its length to be counted
2. Similarly, the lambda `{x 1 0}` specifies the second and first items of a list, implying `field1` is also nested

&nbsp;
```
q)show t:([]field1:(2+5?3)?:`$string[til 10],'"m";field2:(1+5?5)?:5?`3) 
field1 field2 
------------------------------ 
`9m`1m `dmp`gce`gdp 
`4m`3m`9m `gce`dmp`dmp`nmo`gdp 
`8m`9m ,`icg 
`9m`5m`4m `icg`gce`nmo`nmo`gce 
`0m`4m`3m `dmp`icg`icg`gce 
q)select {x 1 0}each field1, #[;1b] each count each field2 from t 
field1 field2 
------------- 
1m 9m 111b 
3m 4m 11111b 
9m 8m ,1b 
5m 9m 11111b 
4m 0m 1111b
```
&nbsp;

Above:

1. the second and first items from each list in `field1`
2. a boolean true for each symbol in the `field2` lists

Alternative expression:

&nbsp;

```
q)select reverse each 2#'field1, not null field2 from t 
field1 field2 
------------- 
1m 9m 111b 
3m 4m 11111b 
9m 8m ,1b 
5m 9m 11111b 
4m 0m 1111b
```

&nbsp;

---

<div class="post-metadata">

**Author:** ![chan\_chenyanj](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chan\_chenyanj](https://forum.kx.com/u/chan_chenyanj)\
**Post date:** [April 9, 2022, 12:00am UTC](https://forum.kx.com/t/how-to-read-this-two-symbols/13461/3 "2022-04-09T00:00:00Z")

</div>

thanks for the reply what does #[;1b] mean

---

<div class="post-metadata">

**Author:** ![rocuinneagain](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/rocuinneagain/32/287_2.png) [@rocuinneagain](https://forum.kx.com/u/rocuinneagain)\
**Post date:** [April 11, 2022, 12:00am UTC](https://forum.kx.com/t/how-to-read-this-two-symbols/13461/4 "2022-04-11T00:00:00Z")

</div>

It is a [projection](https://code.kx.com/q/basics/application/#projection") on [take](https://code.kx.com/q/ref/take/")

```
q)1#1b ,1b 
q)2#1b 11b 
q)#[;1b] 1 ,1b 
q)#[;1b] 2 11b
```

&nbsp;

&nbsp;
