Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

View with query using aggregate functions

$
0
0

I need a cross company view of bank account balances.

I am incompetent with views, but quite nifty with queries in my opinion (I'm probably wrong :D ). The query would look something like this:

BankAccountTable (root) (Cross company)

nested BankAccountTrans (inner join 1:N)

sum(AmountMST)

I tried adding this query, QueryBalances to my view, ViewBalances;;; without success. The view doesn't allow me to drag in queryField sum(AmountMST) and if I manually specify the view field, I get errors. (I can go and check exactly what error it is, if you'd like to know).

I solved the problem by building another query, that looks more or less like this:

BankAccountTrans (root) (cross company)

AccountID

AmountMST

GroupBy AccountID

nested BankAccountTable (inner join 1:1)

*all the necessary detail fields about the account*

Pulled the query into my view and specified a Sum Aggregation  on the AmountMST field.

Which is in working order.

I was just wondering about why my first solution (the preferred one), didn't work. Any comments? Should it work (in other words, I did something wrong), or is it not possible to do that (adding a query sum field to a view)?

Thanks for reading 


Viewing all articles
Browse latest Browse all 72043

Trending Articles