CustTable custTable;
while select count(RecId), CustGroup from custTable
group by CustGroup
order by custTable.RecId desc
{
info(strFmt("%2 - %1", custTable.RecId, custTable.CustGroup));
}
Hello, I've encountered interesting case in AX 2012. Basically what I am trying to do is to sort my data by the amount that count(RecId) returns when it is grouped by CustGroup. Well, "order by custTable.count(RecId) or any other variation of that arises syntax error. Do you have any idea, what to do with this?
I was suggested to use View, but even with View, I couldn't find the solution which lets me order by the expression of aggregated function (count in this case).
*This post is locked for comments
I have the same question (0)