There may be instances when it is necessary to include an attribute form in a derived or a compound metric in order to carry out calculations based on the form value in Strategy Developer 9.x and 10.x.
For example, based on the monthly revenue for a region, the average daily revenue is required to be calculated and displayed for February and March 2003 for each Region. To accomplish this using the Strategy Tutorial project in Strategy Developer 9.x and 10.x, follow the steps below:
- The LU_MONTH table has a column MONTH_DURATION with the number of days for each month for each year.
- Create a new attribute called Month Duration which is mapped to the MONTH_DURATION column in the LU_MONTH table.
- Update the schema.
- Create a metric with the formula Max(Month Duration) {~} (metric max month) called 'max month'.
- Create a report with the Region and Month attributes and the Revenue metric in the grid and filter on Month, selecting February 2003 and March 2003.
- Place the 'max month' metric created in step 4 in the Report objects window.
- Insert a derived metric with the formula (Revenue / ). Execute the report. The report now displays the monthly revenue for each Region for February and March 2003, as well as the average daily revenues for these months, as shown below: