DOORS Script to give metrics on attribute values

Hi,

Does anyone know how I can run metrics on values of an attribute. For ex. run a report that gives me information on how many objects have a certain value in an attribute. If we take the attribute "Object Type" for example, I want to know:
Attribute: Object Type
Values:
Requirement - #
Description - #
Heading - #
Informational Text - #

Can anyone help me with this?

Thank you
ahinduja - Wed Apr 27 10:10:30 EDT 2011

Re: DOORS Script to give metrics on attribute values
mcnairk - Wed Apr 27 10:48:11 EDT 2011

Something like this would display the results to the user; you'd have to add some code to send the output to a file...



// Count   
/* This script counts occurrences of each value of attribute "Object Type" */   Module m = current Object o 

int count = 0 

int count_REQ = 0 

int count_DESC = 0 

int count_HEAD = 0 

int count_INFO = 0   string Object_Type   

for o in m 

do 
{ count++ Object_Type = o.
"Object Type" 

if (Object_Type == 
"Requirement") 
{ count_REQ++ 
} 

if (Object_Type == 
"Description") 
{ count_DESC++ 
} 

if (Object_Type == 
"Heading") 
{ count_HEAD++ 
} 

if (Object_Type == 
"Informational") 
{ count_INFO++ 
}   
}   print 
"Total statements \t Requirement \t Description \t Heading \t Informational \n" print count 
"\t" print count_REQ 
"\t" print ccount_DESC 
"\t" print count_HEAD 
"\t" print count_INFO 
"\t"   
//End Count


Ken.

Re: DOORS Script to give metrics on attribute values
SystemAdmin - Thu Apr 28 06:20:58 EDT 2011

Tools / Functions / Statistics - this gives out a more executive level summary (picture) of attribute values for specified attribute. Note that the script behind this function "/lib/dxl/standard/fns/doorsst.dxl" is unencrypted in DOORS so you can modify it for your needs.

Re: DOORS Script to give metrics on attribute values
ahinduja - Thu Apr 28 10:13:33 EDT 2011

SystemAdmin - Thu Apr 28 06:20:58 EDT 2011
Tools / Functions / Statistics - this gives out a more executive level summary (picture) of attribute values for specified attribute. Note that the script behind this function "/lib/dxl/standard/fns/doorsst.dxl" is unencrypted in DOORS so you can modify it for your needs.

Thank you for the suggestions. I havent done any programing in a while so will have to spend a little time getting comfortable with DXL scripting.

But I appreciate the suggestions - gives me a good starting point.

Thank you

Re: DOORS Script to give metrics on attribute values
KJAI - Mon Jun 17 01:44:50 EDT 2013

SystemAdmin - Thu Apr 28 06:20:58 EDT 2011
Tools / Functions / Statistics - this gives out a more executive level summary (picture) of attribute values for specified attribute. Note that the script behind this function "/lib/dxl/standard/fns/doorsst.dxl" is unencrypted in DOORS so you can modify it for your needs.

Is it possible to send the output of these reports to an attribute. Or can we configure an attribute which gives the statistics on  for example. the total no. of objects.

Re: DOORS Script to give metrics on attribute values
HazelWoodcock - Mon Jun 17 04:27:56 EDT 2013

ahinduja - Thu Apr 28 10:13:33 EDT 2011
Thank you for the suggestions. I havent done any programing in a while so will have to spend a little time getting comfortable with DXL scripting.

But I appreciate the suggestions - gives me a good starting point.

Thank you

If you want the numbers without DXL, or just to check you have the DXL correct, use the filter.  Tools->Filters, filter on a single attribute value and press Apply, not OK. The dialog will show you how many objects have been included in the filter and how many excluded.

If you are doing this regularly, rather than just as a one-off, then you really do want the DXL.