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

KB8180: How to create dynamic custom groups in MicroStrategy Engine


Community Admin

• Strategy


This article discusses about how to create dynamic custom groups in MicroStrategy Engine

 
Sometimes it is useful to let the end-user determine the number of elements in a custom group at run-time. Using the Strategy Tutorial Project in Strategy Engine, a report is subject to the following requirements:

  • Prompt on the beginning and ending date.
  • Prompt on the number of days per band.
  • The report should return a set of dates and the sales amount, grouped in sets of the numbers of days input on the first prompt.

 
To achieve this, the following seven objects are needed:
 
Object 1:
 

Web Analyst
NAME:TYPE: Numeric value promptDEFINITION: This object is the prompt that will ask the end-user for the number of days on each group.

Web Analyst
NAME:TYPE: Numeric value promptDEFINITION: This object is the prompt that will ask the end-user for the number of days on each group.

Web Analyst
NAME:TYPE: Numeric value promptDEFINITION: This object is the prompt that will ask the end-user for the number of days on each group.


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:

 
Object 2:
 


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:

 
Object 3:
 


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:


NAME:TYPE: MetricDEFINITION: ApplySimple("#0", ?)

This metric uses the prompt so it can be used in the calculations.NAME:TYPE: FilterDEFINITION:


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.

 
Object 4:
 


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.

 
Object 5:
 


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.

 
Object 6:
 


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.

 
To understand the approach, consider a report with the following elements:

  • The attribute
  • The four metrics above
  • '8' as an answer to the prompt

 
The report returns the following data:

ka04W000000OahBQAS_0EM440000002G7J.gif

 
Notice that at every eighth element, there will be an integer value for the metric.
 
Following the previous logic, create a custom group:
 
Object 7:
 


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


This filter determines the date range. In this case, no prompt is used for simplicity. Prompts may be used in this filter without issue.NAME:TYPE: MetricDEFINITION: Sum() {~+} <>

This metric will be the one shown on the report. Notice that this metric has the conditionality in it.NAME:TYPE: MetricDEFINITION: RunningCount(SALES)

This metric will be used for grouping purposes.NAME:TYPE: MetricDEFINITION: ( / )

This metric will be used for grouping purposes.NAME:TYPE: Custom GroupDEFINITION: This custom group is a custom group banding qualification created on the metric, with band size banding type and a step size of '1' (integers). Under 'Level…' choose the attribute.


 
When this custom group is placed on a report with the metric and an answer of '8' for the prompt, the following results are returned:

ka04W000000OahBQAS_0EM440000002G7H.gif

 
Seven bands are dynamically created, six with eight dates each and the last one with six dates.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
KB8180


Comment

0 comments

Details

Knowledge Article

Published:

April 20, 2017

Last Updated:

January 3, 2019