Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Total counts w/ Comb of 3 attributes
Topic Summary: Need to get total counts for a combination of 3 attributes. What is the best method?
Created On: 25-Apr-2008 20:26
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 25-Apr-2008 20:26
User is offline View Users Profile Print this message


June Cook

Posts: 2
Joined: 25-Apr-2008

I have 3 attributes to run metrics for.
For each CSC there will be a CDR and for each CDR there will be a SW status. I need to get the total counts of the matches. Problem is that the total number of matches could be huge.
CSC = 11 values
CDR = 8 values
SW = 6 values.
What is the count per SW value, per CDR value, per CSC value, is what I need to get.

// Step 3 Collect data for each attribute
for (a=0; a <= attrSize; a++) {
// Step 4
if (attrCSC == at.strings[a]) { // match top attribute

// count up total for CSC
// Step 5
for (b=0; b <= attrSizeCDR; b++) {
// Step 6
if (attrCDR == atCDR.strings) { // match 2nd attribute

// count up total for CDR per CSC
// Step 7
for (c=0; c <= attrSizeSW; c++) {
// Step 8
if (attrSW == atSW.strings[c]) { // match 3rd attribute

// count up total for SW per CSC.

} // Step 8
} // Step 7
} // Step 6
} // Step 5
} //step 4 if
} // step 3
Report this to a Moderator Report this to a Moderator
 29-Apr-2008 23:57
User is offline View Users Profile Print this message


jason haury

Posts: 39
Joined: 20-Feb-2007

Hi,

With the numbers you gave, it sounds like you could have anywhere from 1 to 528 different numbers you'd report. Will you want this info to be easily placed in a spreadsheet to be tracked over time? If so, you'll likely want to report all 528 values (btw, 11*8*6=528). Otherwise, if you want to generated the shortest possible report for each time you run this script, I recommend using a Skiplist to track which combinations you find as you run through your 3 different attributes. The nifty thing with a skiplist is you can't put items into it with a given key if there's already an item in the skiplist with the key. check out the attached code with an example similar to your scenario. Since I dont know what the different possible values are for the 3 attributes you mentioned (CSC, CDR, and SW), let's consider an example with these following 3 attributes and values:

Animals can be Mouse, Cat, or Dog
Vegitables can be Carrots, Broccoli or Zucchini
Minerals can be Iron, Calcium or NaCl

Thus, in this example, we might have up to 3*3*3=27 numbers to report.

Note: on line 27 where you set "b = ..." you can add in other text to format the key. As is, it will print out something like:
There were 4 Objects with the combination CatZucchiniNaCl

But with some fiddling on line 27, it could read:
There were 4 Objects with the combination Cat - Zucchini - NaCl

Hope it helps!
Jason
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.