Skip to main content
Previous section   Next section

CREATE MEMBER Statement

Creates a calculated member that can be used within the current session.

Syntax and Details

CREATE SESSION MEMBER calc_mem_details, FORMAT_STRING='format_details', SOLVE_ORDER=integer
Where calc_mem_details is as follows:
cube_name.[dimension_name].[new_member_name] AS 'value_expression'
And:
  • cube_name is the name of the cube to which you are adding this member.
  • dimension_name is the name of the dimension to which you are adding this member.
  • new_member_name is the name of a member; the member may or may not be already defined in the cube. If it is, the definition given here takes precedence.
  • value_expression is an MDX expression that defines the calculated member, typically in terms of references to other members. For details, see WITH Clause.
  • FORMAT_STRING='format_details'
    is an optional clause that specifies how to display the values. This clause is applicable only for numeric values. See FORMAT_STRING Clause.
  • SOLVE_ORDER=integer
    is an optional clause that specifies the relative order in which to evaluate this calculated member. This clause is relevant only if the query contains calculated members on both axes. See SOLVE_ORDER Clause.
Also see “Identifiers.”
When you use the MDX shell, a session is started; the session ends when you exit the shell. During this session, if you use the CREATE MEMBER statement, the member that you create is available until the session ends or until you use the DROP MEMBER statement.

Example

First, in the MDX shell, we define a new member in the
Patients
cube:
>>CREATE SESSION MEMBER patients.MEASURES.scoresquared AS 'MEASURES.[test score]*MEASURES.[test score]' 
 
---------------------------------------------------------------------------
Elapsed time:       .013701s
Then we use the new measure in a query:
>>SELECT MEASURES.scoresquared ON 0, aged.[age group].MEMBERS ON 1 FROM patients
                              scoresquared
1 0 to 29                    66,801,054,681
2 30 to 59                   61,070,271,376
3 60+                         9,120,632,004
---------------------------------------------------------------------------
Elapsed time:       .016856s

See Also

Previous section   Next section