OQL Query with Count

0
Hi. I am creating a dataset and am tripping over the OQL slightly. FROM Class.ObjectA oA INNER JOIN oA/Class.ObjectB_ObjectA/Class.ObjectB AS oB GROUP BY oA.Id SELECT oA.Id, oA/Class.ObjectA_User_Stakeholder_AT/Class.User/FullName AS ATMember, COUNT(oB.Id) AS NumberOfObjectB, oA.Column1, oA.ColummnB So, the intent here is to get all records of ObjectB that are included in the parent ObjectA. The problem I have is counting those objects. If I remove all other columns from the dataset and just leave in the ID and the Count then it works fine. Adding the additional columns causes a failure.   Can anyone point me to my mistake? Thanks.   ** EDIT ** So it would appear that my error is not the COUNT, it’s the link to the USER, although I still don’t know how to fix it!
asked
1 answers
0

Try the correct order of statements:

 

SELECT oA.Id, oA/Class.ObjectA_User_Stakeholder_AT/Class.User/FullName AS ATMember, COUNT(oB.Id) AS NumberOfObjectB, oA.Column1, oA.ColummnB

FROM Class.ObjectA oA INNER JOIN oA/Class.ObjectB_ObjectA/Class.ObjectB AS oB

GROUP BY oA.Id

answered