Go to primary content

Share

Calculates the ratio of the measure value for the current hierarchy member to the value of a selected member.

The template presents a measure of the analytic view, an attribute dimension the analytic view is dimensioned by, and a level of the attribute dimension. To select a different measure, attribute dimension, or level, click an underlined value in the template and make a selection from the Select Measures dialog box or the drop-down list.

Template

Share of the measure name measure for the hierarchy alias hierarchy of the attribute dimension alias attribute dimension as a ratio of the { member's ancestor at level level name | member's parent }.

Example: Example of Share

The sales_share_geog_parent calculated measure computes the percentage that each member of the GEOGRAPHY_HIER hierarchy contributes to its parent in the SALES measure.

Calculation in Template

Share of the measure SALES in the GEOGRAPHY_HIER hierarchy for the GEOGRAPHY_ATTR_DIM attribute dimension as a ratio of the member’s parent.

Definition of Calculated Measure in Analytic View

The MEASURES clause of the SALES_AV analytic view definition includes this definition of the sales_share_geog_parent calculated measure:

  sales_share_geog_parent AS
    (SHARE_OF(sales HIERARCHY geography_hier PARENT))

SELECT Statement Using the Calculated Measure

Query the analytic view, selecting hierarchy members, sales values, and the ratio of sales by the GEOGRAPHY_HIER parent.

SELECT time_hier.member_name AS TIME,
  product_hier.member_name   AS product,
  geography_hier.member_name AS geography,
  sales,
  ROUND(sales_share_geog_parent, 2) as sales_share_geog_parent
FROM sales_av HIERARCHIES (
  time_hier,
  product_hier,
  geography_hier
  )
WHERE time_hier.member_name  = 'CY2014'
AND product_hier.level_name = 'DEPARTMENT' 
AND geography_hier.parent_unique_name = '[REGION].&[NORTH_AMERICA]'
ORDER BY time_hier.hier_order,
    geography_hier.hier_order,
    product_hier.hier_order;

Results of the Query

TIME    PRODUCT                   GEOGRAPHY     SALES         SALES_SHARE_GEOG_PARENT
------  ------------------------  ---------     ------------  -----------------------
CY2014  Cameras and Camcorders    Canada         11463357.67    0.14
CY2014  Computers                 Canada        159825762.85    0.14
CY2014  Portable Music and Video  Canada          2994091.73    0.14
CY2014  Cameras and Camcorders    Cuba             2202679.6    0.03
CY2014  Computers                 Cuba           31636659.68    0.03
CY2014  Portable Music and Video  Cuba             589804.93    0.03
CY2014  Cameras and Camcorders    Mexico         22947147.42    0.27
CY2014  Computers                 Mexico        317201989.63    0.27
CY2014  Portable Music and Video  Mexico          5923619.01    0.27
CY2014  Cameras and Camcorders    United States  47064554.18    0.56
CY2014  Computers                 United States 657717110.46    0.56
CY2014  Portable Music and Video  United States  12316236.95    0.56