I am querying thru the business connector and I need to get the maxof and sum of the same field. Since there is no way to alias in AX is this possible?
Here is my query
Select KEY1, maxof(REALCONSUMP), sum(REALCONSUMP) FROM %1 GROUP BY KEY1,PRODID WHERE PRODID == '{0}'
If I use .get_Field("REALCONSUMP") I get the maxof but I dont know how to get the maxof.
Thanks
Brian
*This post is locked for comments
LOL! Good question. I got so caught up in the aggregates I didn't notice I still had that in the group by. Thanks for the answer.
No, it's not possible. AX returns a table buffer; its fields are defined at design time and not at runtime. There is just one RealConsump field.
You need a different approach, such as two queries.
By the way, what's the point of grouping by ProdId if the query is filtered to return data just for a single ProdId?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156