Click here to Skip to main content
15,439,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am customizing a report in TFS, the report include a matrix used to show the result result of a Test Plan and Test Cases. Currently the report shows all the Test Runs result for each test case.

e.g. There is a test plan contains 2 test cases, tester run each test case 2 times. The first time is failed, the 2nd time is success. Then in the report, it will show the test plan totally has 2 failed runs and 2 successed runs.

Actually we don't care the result of every run for a case. We just case the last run result for each case. The MDX in the dataset for the matrix is as below:
SQL
SELECT 
NON EMPTY { [Measures].[Result Count] } ON COLUMNS, 
NON EMPTY { ([Test Plan].[Test Plan Name].[Test Plan Name].ALLMEMBERS * 
	[Test Suite].[Suite Path].[Suite Path].ALLMEMBERS * 
	[Test Case].[System_Id].[System_Id].ALLMEMBERS * 
	[Test Configuration].[Configuration Name].[Configuration Name].ALLMEMBERS * 
	[Test Result].[Outcome].[Outcome].ALLMEMBERS * 
	[Test Run].[Test Run ID].[Test Run ID].ALLMEMBERS )
 } 
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
FROM ( SELECT ( -{ [Test Run].[Test Run ID].[All].UNKNOWNMEMBER } ) ON COLUMNS 
	FROM ( SELECT ( -{ [Test Suite].[Suite Path].[All].UNKNOWNMEMBER } ) ON COLUMNS 
		FROM ( SELECT ( STRTOSET(@TestPlanTestPlanName, CONSTRAINED) ) ON COLUMNS 
			FROM [Team System]
		)
	)
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS


In the query, every test case has multiple coressponding test runs. I just want to select the one which has biggest Test Run ID.

Please teach me how to make it.

Thanks Very much
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900