EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB441090: How to retrieve a list of filter properties given filter location in MicroStrategy 10.4 Command Manager


Stanislav Gordiienko

Senior Product Manager • MicroStrategy


In MicroStrategy Command Manager there is a way to obtain list of filter specific properties (such as expressions). In order to achieve so, Command Manager procedure has been provided as a sample.

In Command Manager, procedures are reusable scripts that can be executed from other scripts.
You can reuse procedures with different input values, so that the procedure performs the same task in a slightly different way.
Strategy installation provides multiple sample procedures for users to get a grasp of general outlook of procedures, its functionality, expected outlines, etc.
Frequently the capabilities of procedures go beyond of what has been included in sample procedures.
Below provided is a content of procedure to list filter properties in dedicated folder:


String sFilter = null;
// Retrieve all filters under the specified folder
ResultSet oAllFilters = executeCapture("LIST ALL FILTERS IN FOLDER '" + sFolder + "' FOR PROJECT '" + sProject + "';");

oAllFilters.moveFirst();
if(oAllFilters.getRowCount() > 0){
	while(!oAllFilters.isEof()){
		// Get properties for each filter
		sFilter = oAllFilters.getResultCell(DisplayPropertyEnum.NAME).getValueString();
		ResultSet oFilter = executeCapture("LIST PROPERTIES FOR FILTER '"+ sFilter +
			"' IN FOLDER '" + sFolder + "' FOR PROJECT '" + sProject + "';");

		oFilter.moveFirst();        
		// Here we will consume the filter properties by printing out only the desired properties    
		while(!oFilter.isEof()){
			// General properties such as Name, ID, expression, etc
			printOut("Name = " + oFilter.getResultCell(DisplayPropertyEnum.NAME).getValueString());
			printOut("EXPRESSION = " + oFilter.getResultCell(DisplayPropertyEnum.EXPRESSION).getValueString());
			oFilter.moveNext();
		}        
		oAllFilters.moveNext();
	}
}else{
	printErr("There are no Filters for project '" + sProject + "'.");
}

This procedure is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this proceedure will be provided. In the event of a code change in future builds, Strategy may not be able to provide updated procedure on this matter even though this procedure is provided at this time for this specific build. For enhancements to this procedure or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.
To learn more about procedures, please refer to System Administration Guide.


Comment

0 comments

Details

Knowledge Article

Published:

June 26, 2018

Last Updated:

November 12, 2018