Group by on multiple dimensions


Hello, I want to know which is the equivalent form to execute “group by” statement on multiple dimensions in AQL language.

My array definition is:

AFL% show(A);
{i} schema
{0} 'A<val:int32> [i=0:2,2,0,j=0:2,2,0,z=0:5,5,0]'

and when I use the group by on one dimension it work’s well:

AQL% select count(val) from A group by i;
{i} count
{0} 18
{1} 18
{2} 18

but when I try to make the same aggregation on multiple dimensions the result is the same:

AQL% select count(val) from A group by i , j;
{i} count
{0} 18
{1} 18
{2} 18

I know that it can be solved using AFL aggregate statement but I want to know how to obtain the same result in AQL

AFL% aggregate(A,count(val), i , j );
{i,j} val_count
{0,0} 6
{0,1} 6
{1,0} 6
{1,1} 6
{0,2} 6
{1,2} 6
{2,0} 6
{2,1} 6
{2,2} 6


Yeah. That’s a bug. The translation from AQL to AFL isn’t complete.

We’re focusing (at the moment) on getting AFL to work well. For the time being. I would use AFL, rather than AQL.


Thank you for your reply.