# Getting a list of values using lua and aerospike aql

**URL:** <https://discuss.aerospike.com/t/getting-a-list-of-values-using-lua-and-aerospike-aql/4021>\
**Category:** General Discussion\
**Tags:** lua, aql\
**Created:** [April 4, 2017, 3:25pm UTC](https://discuss.aerospike.com/t/getting-a-list-of-values-using-lua-and-aerospike-aql/4021 "2017-04-04T15:25:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuspB](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@JuspB](https://discuss.aerospike.com/u/JuspB)\
**Post date:** [April 4, 2017, 3:25pm UTC](https://discuss.aerospike.com/t/getting-a-list-of-values-using-lua-and-aerospike-aql/4021/1 "2017-04-04T15:25:26Z")

</div>

Hello,

I have the following set in aerospike:

```
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (1,2,2017,10)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (2,2,2017,11)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (3,3,2017,12)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (4,3,2017,13)

```

I’m new in aerospike and for the moment I just know how to retrieve a single value in LUA, but I would like to know how to retrieve and make groups of values.

For instance, I would like to know how could I return a result like the following in aql:

```
  AGGREGATE test.someFunction() ON test.set

    +------+--------------+------+
    | YEAR | DAY_OF_MONTH | SUMA |
    +------+--------------+------+
    | 2017 | 2 | 21 | 
    | 2017 | 3 | 25 |
    +------+--------------+------+

```
