It's all about the answers!

Ask a question

How to calculate average age of work items with respect to field against attribute in IBM RPE?


meghana kaddu (219) | asked Nov 01 '20, 1:20 a.m.

 Hi,

Can anyone please help in finding out the script or any other possible ways to calculate average age of the work items based on filed against attribute through RPE.




Accepted answer


permanent link
Subramanya Prasad Pilar (4.6k16) | answered Nov 09 '20, 1:11 p.m.

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.

meghana kaddu selected this answer as the correct answer

Comments
meghana kaddu commented Nov 11 '20, 1:45 a.m.

Hi Subramanya,


Thank you for the response, Can you please attach any reference dta file ? That will be a great help.

Thanks and Regards,
Meghana 


Subramanya Prasad Pilar commented Nov 11 '20, 7:48 p.m.

Here is the sample template you can refer to.

2 other answers



permanent link
Fariz Saracevic (919613) | answered Nov 01 '20, 6:28 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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:


1) Java scripting
2) Create hybrid document using JRS data within PUB. If you can create JRS report with calculation you are looking  for, you can use JRS export to PUB option to get necessary PUB template details.

Hope this helps.


permanent link
meghana kaddu (219) | answered Nov 01 '20, 6:39 a.m.

 Hi Fariz,


Thank you for the reply, I checked the possibilities through JRS. It is not possible so I am checking the way to do in rpe, whether it is possible to calculate average age of work item with respect to an attribute value in Rpe?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.