Oracle® OLAP Expression Syntax Reference Release 11.2 Part Number E23381-01 |
|
|
PDF · Mobi · ePub |
SHARE
calculates the ratio of an expression's value for the current dimension member to the value for a related member of the same dimension. Arguments to this function identify which related member is used in the ratio.
NUMBER
share_expression::=
SHARE (expression share_clause [share_clause]... )
share_clause::=
OF { DIMENSION dimension_id | HIERARCHY hierarchy_id } { PARENT | TOP | MEMBER 'member_name' | DIMENSION LEVEL dim_level_id | HIERARCHY LEVEL hier_level_id }
A dimensional expression whose values you want to calculate.
A dimension of expression
. The default hierarchy is used in the calculation. If you want to use a different hierarchy, use the HIERARCHY
argument instead.
A level hierarchy of expression
A member of the specified dimension or hierarchy.
The name of a level of dimension_id
.
The name of a level of hierarchy_id
.
Share is calculated with these formulas:
Keyword | Formula |
---|---|
PARENT |
current member/parent |
TOP |
current member/root ancestor |
MEMBER |
current member/specified member |
DIMENSION LEVEL |
current member/ancestor at specified level or null if the current member is above the specified level. |
This example calculates the percent share of the parent member for each product. The results appear in the Share of Parent column.
(SHARE(UNITS_CUBE.SALES OF HIERARCHY PRODUCT.PRIMARY PARENT))*100
The next example calculates the percent share of Total Product for each product. The results appear in the Share of Top column.
(SHARE(UNITS_CUBE.SALES OF HIERARCHY PRODUCT.PRIMARY TOP))*100
Product | Parent | Sales | Share of Parent | Share of Top |
---|---|---|---|---|
Desktop PCs | HRD | 74556528 | 60 | 54 |
Portable PCs | HRD | 18338225 | 15 | 13 |
CD/DVD | HRD | 16129497 | 13 | 12 |
Memory | HRD | 5619219 | 5 | 4 |
Modems/Fax | HRD | 5575726 | 4 | 4 |
Monitors | HRD | 3972142 | 3 | 3 |
Accessories | SFT | 6213535 | 49 | 5 |
Operating Systems | SFT | 4766857 | 37 | 3 |
Documentation | SFT | 1814844 | 14 | 1 |
Hardware | TOTAL | 124191336 | 91 | 91 |
Software/Other | TOTAL | 12795236 | 9 | 9 |