How to calculate average age of work items with respect to field against attribute in IBM RPE?
Accepted answer
You can first store unique category values (workitem/workItem/category/name) in an array. Then iterate over each array element (using an Iteration element in RPE template). Within Iteration element, use a filter to get workitems filtered by category/name, get the indidual age using following Script Expression:
var today = new Date();
var createdYear = creationDate.toString().substr(0,4);
var createdMonth = creationDate.toString().substr(5,2)-1;
var createdDate = creationDate.toString().substr(8,2);
var created = new Date(createdYear, createdMonth, createdDate);
var created = new Date(creationDate.toString());
_age = age1 + Math.round((today - created)/(1000606024));
_count = _count*1 + 1;
_age/_count will give the average age.
Comments
Hi Subramanya,
Here is the sample template you can refer to.
2 other answers
Publishing (formerly RPE) is used mainly for documentation purpose and it depends on application data. If application does not provide such value, there are some techniques that you might want to try: