Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
At the Project level, I need to follow the "Documented By" relationship field, and calculate the "Last Week Document Churn" from Requirement Specification Documents and Test Protocol Documents, separately.
Below expression gives total for all documents in the "Documented By" relationship field.
<%compute%>aggregateByTree("Documented By",sum("Last Week Document Churn"))<%endcompute%>
Is there a way to add a type constraint (e.g. Type == "Requirement Specification Document"). I tried, but they all give syntax errors.
Can someone please help me?
Thank you,
Balu
Solved! Go to Solution.
Came up with below computed expressions for computing Last Week Document Churn, separately for Requirement Spec Docs and Test Protocol Docs, following the "Documented By" relationship field in a Project item:
<%compute%>aggregateByTree("Documented By", sum(isType("Requirement Specification Document") ? "Last Week Document Churn" : 0))<%endcompute%>
<%compute%>aggregateByTree("Documented By", sum(isType("Test Protocol Document") ? "Last Week Document Churn" : 0))<%endcompute%>
I took a different approach for the computed fields, and was able to solve this. Create a regular query for your document type (e.g. "All Requirement Specification Documents"), then use it in a compute Query function in the report with "Project" as a correlation field and sum for the aggregate expression.
<%compute%>Query("All Requirement Specification Documents", Project, sum("Last Week Document Churn"))<%endcompute%>
<%compute%>Query("All Test Protocol Documents", Project, sum("Last Week Document Churn"))<%endcompute%>
Came up with below computed expressions for computing Last Week Document Churn, separately for Requirement Spec Docs and Test Protocol Docs, following the "Documented By" relationship field in a Project item:
<%compute%>aggregateByTree("Documented By", sum(isType("Requirement Specification Document") ? "Last Week Document Churn" : 0))<%endcompute%>
<%compute%>aggregateByTree("Documented By", sum(isType("Test Protocol Document") ? "Last Week Document Churn" : 0))<%endcompute%>