Skip Headers
Oracle® OLAP Expression Syntax Reference
Release 11.2

Part Number E23381-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

SHARE

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.

Return Value

NUMBER

Syntax

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 
   }

Arguments

expression

A dimensional expression whose values you want to calculate.

dimension_id

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.

hierarchy_id

A level hierarchy of expression

member_name

A member of the specified dimension or hierarchy.

dim_level_id

The name of a level of dimension_id.

hier_level_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.

Example

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